Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to best utilize C++/python combination?  (Read 2252 times)

0 Members and 1 Guest are viewing this topic.

grim

  • Guest
How to best utilize C++/python combination?
« on: July 28, 2014, 05:39:43 pm »
I want to write as much of my game in python as possible, using c++ to handle graphics and low level stuff.  What would be the best way to handle this?  Can I run my main game loop in python and make calls to c++ methods when the screen needs to be updated and drawn? Or should I have the main game loop in c++ and just have it make calls to python methods and objects?  Which would be better and/or more efficient?

For clarification, everything related to game data would be in python, not just data manipulation algorithms.  So classes and their methods would be in python too.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: How to best utilize C++/python combination?
« Reply #1 on: July 28, 2014, 05:46:47 pm »
Not exactly what you asked, but check out Kivy.

grim

  • Guest
Re: How to best utilize C++/python combination?
« Reply #2 on: July 28, 2014, 05:49:51 pm »
I know about kivy, but that's not what I meant. What I meant is that I am going to write part of the game in C++ and then part of the game in python, not use some special library that mixes the two together.  Besides I believe kivy is java and python.

Mörkö

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: How to best utilize C++/python combination?
« Reply #3 on: July 30, 2014, 10:08:18 am »
For clarification, everything related to game data would be in python, not just data manipulation algorithms.  So classes and their methods would be in python too.

I don't understand, what are your methods doing, if they aren't doing "data manipulation"? Please clarify what you are talking about with a more elaborate explanation, and preferably some pseudo code examples.