Archived

This topic is now archived and is closed to further replies.

OOProgrammer

Embedded scripting languages conflict with win32 message handling?

Recommended Posts

Alright, I''ll say this one thing first about myself: I know NOTHING about win32 programming. I''m in part 2 of Game Programming Genesis and have skimmed most of the rest of it. So I was wondering about how embedded scripting languages (like Python) affect win32 message handling. As the author of GPG said, you must execute your main game loop as many times per second as is reasonably possible so that messages get taken care of. But how do you tell an embedded scripting language to pause script execution so that your main game loop can be executed again? The author used a scripting engine he wrote himself which had provisions built-in to pause execution of more intensive script functions. Does this mean that any intensive operations must be performed with a hard-coded function, so that I can specify a pause in execution, or do scripting languages like Python, Perl, and Lua have built-in provisions for this? Thanks for the help. -OOProgrammer Let the noob-flaming begin!

Share this post


Link to post
Share on other sites
In general, I would assume that the scripting engine would run in a separate thread - although that would depend on the implementation. Consider how a web server or web browser handles scripting. A java-script routine isn''t supposed to prevent you from alt-tabbing away from the browser. A perl script doesn''t necessarily prevent a web server from delivering pages to other clients. For specifics related to a particular scripting language, you''ll probably want to consult the docs for that language. They should provide pointers on embedding their script into a program. I know there''s info at mozilla.org regarding embedding the java-script engine (aka spider monkey) into an application and there''s a newsgroup on the subject as well.

Share this post


Link to post
Share on other sites