From 58355da40b9cda056f17096e43113dd9c435b5c2 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Sat, 28 Mar 2009 13:08:29 +0000 Subject: [PATCH] A few more tiny steps in the right direction Getting templates to work is the next thing --- library/CMakeLists.txt | 3 +-- library/bindings/Enums.i | 2 +- library/bindings/PolyVoxCStdInt.i | 6 ++++++ library/bindings/PolyVoxCore.i | 14 +++++++++++--- library/bindings/PolyVoxForwardDeclarations.i | 6 ++++++ library/bindings/TypeDef.i | 6 ++++++ library/bindings/Utility.i | 6 ++++++ library/bindings/Vector.i | 10 ++++++++++ 8 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 library/bindings/PolyVoxCStdInt.i create mode 100644 library/bindings/PolyVoxForwardDeclarations.i create mode 100644 library/bindings/TypeDef.i create mode 100644 library/bindings/Utility.i create mode 100644 library/bindings/Vector.i diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index ff17aef8..f20a1e04 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -149,8 +149,7 @@ if(SWIG_FOUND) set_source_files_properties(bindings/PolyVoxCore.i PROPERTIES CPLUSPLUS ON) swig_add_module(PolyVoxCore python bindings/PolyVoxCore.i) - swig_link_libraries(PolyVoxCore ${PYTHON_LIBRARIES}) - message(STATUS "${SWIG_MODULE_PolyVoxCore_REAL_NAME}") + swig_link_libraries(PolyVoxCore ${PYTHON_LIBRARIES} PolyVoxCore) set_target_properties(${SWIG_MODULE_PolyVoxCore_REAL_NAME} PROPERTIES SUFFIX ".pyd") endif() diff --git a/library/bindings/Enums.i b/library/bindings/Enums.i index 3d397669..f2ab9d0b 100644 --- a/library/bindings/Enums.i +++ b/library/bindings/Enums.i @@ -3,4 +3,4 @@ #include "PolyVoxCore/Enums.h" %} -enum NormalGenerationMethod; +%include "PolyVoxCore/Enums.h" diff --git a/library/bindings/PolyVoxCStdInt.i b/library/bindings/PolyVoxCStdInt.i new file mode 100644 index 00000000..aac4c29d --- /dev/null +++ b/library/bindings/PolyVoxCStdInt.i @@ -0,0 +1,6 @@ +%module PolyVoxCStdInt +%{ +#include "PolyVoxCore/PolyVoxCStdInt.h" +%} + +%include "PolyVoxCore/PolyVoxCStdInt.h" diff --git a/library/bindings/PolyVoxCore.i b/library/bindings/PolyVoxCore.i index 25ae720f..e771e25f 100644 --- a/library/bindings/PolyVoxCore.i +++ b/library/bindings/PolyVoxCore.i @@ -1,3 +1,11 @@ - %module PolyVoxCore - - %include Enums.i \ No newline at end of file +%module PolyVoxCore + +#define POLYVOX_API +//%include + +//%include "TypeDef.i" +%include "Enums.i" +%include "PolyVoxCStdInt.i" +%include "Utility.i" +%include "PolyVoxForwardDeclarations.i" +//%include "Vector.i" diff --git a/library/bindings/PolyVoxForwardDeclarations.i b/library/bindings/PolyVoxForwardDeclarations.i new file mode 100644 index 00000000..9a991630 --- /dev/null +++ b/library/bindings/PolyVoxForwardDeclarations.i @@ -0,0 +1,6 @@ +%module PolyVoxForwardDeclarations +%{ +#include "PolyVoxCore/PolyVoxForwardDeclarations.h" +%} + +%include "PolyVoxCore/PolyVoxForwardDeclarations.h" diff --git a/library/bindings/TypeDef.i b/library/bindings/TypeDef.i new file mode 100644 index 00000000..e2dd1f9a --- /dev/null +++ b/library/bindings/TypeDef.i @@ -0,0 +1,6 @@ +%module TypeDef +%{ +#include "PolyVoxCore/TypeDef.h" +%} + +%include "PolyVoxCore/TypeDef.h" diff --git a/library/bindings/Utility.i b/library/bindings/Utility.i new file mode 100644 index 00000000..f61fc5d6 --- /dev/null +++ b/library/bindings/Utility.i @@ -0,0 +1,6 @@ +%module Utility +%{ +#include "PolyVoxCore/Utility.h" +%} + +%include "PolyVoxCore/Utility.h" diff --git a/library/bindings/Vector.i b/library/bindings/Vector.i new file mode 100644 index 00000000..dc341a8e --- /dev/null +++ b/library/bindings/Vector.i @@ -0,0 +1,10 @@ +%module Vector +%{ +#include "PolyVoxCore/Vector.h" +%} + +%include "PolyVoxCore/Vector.h" + +%template(VectorTest) PolyVox::Vector<3,float>; + +%rename(assign) VectorTest::operator=;