Re: How to access an Array and a struct within a struct wrapped by Swig ?

2008-08-21 Thread emmanuel . rivoire
Thanks to point this out. It confirmed that I thought : must _manually_ write set/get functions for every array in a every structure (it looks like middle-age ;) ). Coz of this and a few other stuff, while looking at my code, I came to the conclusion that I will be better writing interface C

Re: How to access an Array and a struct within a struct wrapped by Swig ?

2008-08-19 Thread jparker104
On Aug 17, 11:30 pm, [EMAIL PROTECTED] wrote: Anish Chapagain, I already know how to use structure, as my example shown it. I had trouble only with the nested structures, and it was coz of missing typedef (ie: Swig need C struct declaration, not C++). And I still cannot find how to get my

Re: How to access an Array and a struct within a struct wrapped by Swig ?

2008-08-17 Thread emmanuel . rivoire
Anish Chapagain, I already know how to use structure, as my example shown it. I had trouble only with the nested structures, and it was coz of missing typedef (ie: Swig need C struct declaration, not C++). And I still cannot find how to get my arrays... :-S --

How to access an Array and a struct within a struct wrapped by Swig ?

2008-08-16 Thread emmanuel . rivoire
Hello, I spent almost a week to be able to embed Python within my C++ game engine. I wrote a mini-tutorial of what I was able to do so far here : http://forums.indiegamer.com/showpost.php?p=169352postcount=9 At the end of my tutorial, I wrote : You can do the same with C++ classes, and with

Re: How to access an Array and a struct within a struct wrapped by Swig ?

2008-08-16 Thread emmanuel . rivoire
Ok, Swig needs the structure to be declared like this : typedef struct SIn { int in1, in2; } SIn; Else, it doesn't understand it's a structure... :-S Now, I can write to it. I also found out that Swig didn't allow to write to the array : http://www.swig.org/Doc1.3/SWIG.html#SWIG_nn34 ...

Re: How to access an Array and a struct within a struct wrapped by Swig ?

2008-08-16 Thread Anish Chapagain
Hi, If you have struct defined in .h file then it's ok or can dea easyily with struct written with .i file, in .h file, struct def { int a; char name[10]; }; can be referenced as strvar=new_def() //now strvar is