|
Boost : |
From: Pål Frogner Hansen (pal_at_[hidden])
Date: 2002-05-30 06:17:00
I'm looking for examples on how to get the integration C++/Python going!
I am able to generate dll's that exposes a C++ interface to python ("pythonglue"). Great!
What I want it to call functions inside a script from C++. In my game, how can I, for example:
[C++ code:]
(init python)
(load the script into memory)
(setup variables, etc.)
for all items on scene{
call_a_function_from_the_loaded_script( "multiplexer_method", cur_item );
}
The pythoncode looks something like this:
import pythonglue # exposes the C++ api
def multiplexer_method(object):
# Call the function in the dict with the correct name
return function_map[ "do"+object.__class__.__name__ ]()
...
The main problem is to find the funtion call_a_function_from_the_loaded_script in boost... Also can I pass pointers as parameters?
I want to add that any XXX_Run_File_XXX(FILE*)-methods typically crashes too.
Any hints?
-pål (using win2k, locally compiled python2.2.1, boost 1.27/1.28)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk