• entries
570
2427
• views
217369

# Untitled

269 views

lolol okay, almost done with the basic data-sharing. Here's the usage I've worked out for it:

You take your happy user-defined POD struct. Well, it doesn't have to be a POD, since Python takes the offsets into the struct just fine. I guess it isn't going to handle inheritence at this point, but whatever. SO YOU HAVE A POD CLASS ANYWAY:
struct Rah {	int arg1;	char* arg2;};

You then call some code to get a registration stub, which you use to set up exactly which members you'd like to expose to python, what you'd like them to be referenced as, blah blah then you finalize the stub (which deletes it!!!) -
	StructRegStub* stub = exposeDataType( "Rah" );	stub->exposeMember( "arg1", &Rah::arg1 );	stub->exposeMember( "arg2", &Rah::arg2 );	stub->finalize();

And then boom your class is now recognized in Python and you can send them back and forth and stuff. Except you can't yet because I haven't coded that. Well, I might of (actually, I think I did). But I haven't tested it yet.

And besides there's still a couple bugs in the first part (lol, shit breaking: offsets, members overwriting each other, etc.) so I have to fix that first :3

## 1 Comment

Nice! I love the way this system works as it eliminates the trouble of the engine <-> script communcation that other *lua* scripting languages fuck you up with.

## Create an account

Register a new account