FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: Using FIFE as a shared library (w/o Python)  (Read 3807 times)

errantlinguist

  • Newbie
  • Posts: 2
    • View Profile
Using FIFE as a shared library (w/o Python)
« on: December 21, 2011, 11:47:51 am »

I'm trying to get started with FIFE on my own project and would like to know if there is any documentation or tutorial stuff on using the FIFE engine C++ libraries directly in my own C++ code (i.e. not through Python).

Python is a nice language, but I'd like to try to make my project a pure C++ application-- one of my main reasons for doing this is to do a lot of C++ "dirty work", building my own project from the ground up while avoiding the REALLY ugly parts like interfacing with the graphics/sound card, etc. The documentation for using FIFE through Python is pretty good, but it seems to be non-existent for C++.
Logged

vtchill

  • Developer
  • Full Member
  • *
  • Posts: 206
    • View Profile
Re: Using FIFE as a shared library (w/o Python)
« Reply #1 on: December 30, 2011, 07:54:51 am »

Hello! Glad to hear you are using fife and kudos for wanting to learn c++.

As you have seen the fife documentation for c++ is lacking and that is mainly because all of our game creators are currently utilizing python. I wrote some quick tutorial code in c++ for interfacing to fife and it is located here:
http://code.google.com/p/fife-tutorials/

The documentation on that site is a little scarce, and the build code currently only works with visual studio 2008, but the short description is on windows build fife as a static lib and link your code to it. On linux you should be able to build fife as a .so or .a (dynamic or shared) since linux exports all symbols by default but this has yet to really be tested.

The real benefit to the tutorials is to see how to use fife from c++ and the code is documented pretty well so feel free to look over the code and check it out from the repo, the direct link for the source:
http://code.google.com/p/fife-tutorials/source/browse/#svn%2Ftrunk
Logged

theWall

  • Newbie
  • Posts: 2
    • View Profile
Re: Using FIFE as a shared library (w/o Python)
« Reply #2 on: March 11, 2013, 11:15:38 am »

I read this topic because I'm also trying to do it through the C++ way. I’m used to work with C++. I have downloaded the latest version of source and I have also downloaded the C++ tutorial. But I have the problem that they are not compatible.

The latest version of the engine doesn’t have files like “video/resource_location.h” and others. But the tutorial includes them. I have this files found in the branch “engine_maploader”. But if I put the tutorial in this branch I get some errors in “boost/filesystem” files. For example on “directory_path” which is marked as deprecated.

I don’t know if I’m doing something wrong, or have anything overseen, or is it really so that the branch is branched from older version of the engine.

Please, if it is possible, could someone give me the hint how get a set of source compatible with this C++ tutorial.
Logged

ChrisOelmueller

  • Newbie
  • Posts: 15
    • View Profile
Re: Using FIFE as a shared library (w/o Python)
« Reply #3 on: March 11, 2013, 01:34:58 pm »

Hi,

maybe check the new location of those tutorials at github: https://github.com/fifengine/cpp-tutorials
Logged

theWall

  • Newbie
  • Posts: 2
    • View Profile
Re: Using FIFE as a shared library (w/o Python)
« Reply #4 on: March 12, 2013, 08:30:43 am »

I have tryied also this repository but there isn't any "build" directory with project/solution files. And the version on github has less source than the version on svn. No "tinyxml" source, only a little part of graphics. It seems to me that the version on github is older than the version on svn. But I can be wrong, therefore am I asking.
Logged