Orx

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Orx

Postby duke4e » Jan 19, 2010 8:08

Orx is an open source, portable, lightweight, plugin-based, data-driven and extremely easy to use 2D-oriented game engine.

It has been created to allow fast creation of games and prototypes. It's licensed under LGPL meaning that you can use it (and modify it) for free for any kind of projects, freeware or commercial.

Orx provides a complete framework for game development and currently runs on windows (mingw and native using visual studio), linux (x86) and MacOS X (ppc/x86).

Another port, the GP2X version, is in its debug stage whereas the iPhone/iPod Touch version should be available early 2010.

Orx is a full featured and powerful "2.5D" game engine. All objects and cameras are created in a 3D space, but only a 2D rendering plugin is currently available. Adding 3D rendering will probably come after its v1.0 release as it's not part of the current focus.


Orx is mostly written in C (with some plugins in C++) but allows you to develop with it with any language that can interface to C (like C++ or Objective-C for example).


Since this is true, can someone try to translate it into FB or at least give me the right directions, since I've never translated any headers due lack of sufficient C knowledge.

http://orx-project.org/
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Re: Orx

Postby AGS » Jan 20, 2010 1:05

duke4e wrote:
Orx is mostly written in C (with some plugins in C++) but allows you to develop with it with any language that can interface to C (like C++ or Objective-C for example).


Since this is true, can someone try to translate it into FB or at least give me the right directions, since I've never translated any headers due lack of sufficient C knowledge.

http://orx-project.org/


I've checked out the Orx header files and found a couple of things.

Overall the header files do not seem to contain many function - like macros which is a good thing. The header files do contain loadsa comments and little translatable material. In many header files about 50% of content consist of comments.

Some header files use quite a lot of functions that are defined inline.

That's not so good because you'd have to translate these to 'plain' FreeBASIC functions. I found the inline functions in the UDTs defined/used by the orx library so translating them to FB functions might have an effect on the runtime performance of the library.

I did a count on the number of lines of code in the header files. Result:



http://cloc.sourceforge.net v 1.08 T=3.0 s (23.3 files/s, 4844.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code scale 3rd gen. equiv
-------------------------------------------------------------------------------
C/C++ Header 70 2984 7322 4226 x 1.00 = 4226.00
-------------------------------------------------------------------------------
SUM: 70 2984 7322 4226 x 1.00 = 4226.00
-------------------------------------------------------------------------------


So that's 4226 lines of C source code to translate. By when did you say you wanted to have the Orx header files translated? Tomorrow ;)?

If you want I can do the translation. I think doing a proper translation of the header files would take me...... one week (give or take a couple of days, this includes the time it takes to test the translated files).

(I'm not using SWIG, all I use are 'well aimed' regexes).
v1ctor
Site Admin
Posts: 3799
Joined: May 27, 2005 8:08
Location: SP / Bra[s]il
Contact:

Postby v1ctor » Jan 20, 2010 2:59

Btw, all functions are defined as fastcall, what isn't supported by FB.

You would have to change that fastcall #define to blank and rebuild the library with MinGW, so not just the translated headers would be included in the distro, the .dll and the .a too.
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Postby duke4e » Jan 20, 2010 8:12

It's nice that you offer yourself to translate those file, but if you do so, I'd like to help. It's time for me to at least try to learn how to translate needed files, so I don't post here for help every time I need some new library.
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Postby AGS » Jan 20, 2010 19:00

I was hoping fastcall would not pose a problem but no such luck :(

I found this as well on the net:
However, very early on I ran into a problem. orx seems to use the __fastcall calling convention for alot of
functions. Unfortunatly the CLR is not compatible with this and tries to convert them all to __stdcall,
which results in linker errors because of function signature mismatch.


So the people using .NET seem to be having trouble with fastcall as well.

Compiling orx from sources is no small thing. Orx uses quite a few external libraries: you need to download over 30MB of source code (all external dependencies) in order to be able to compile orx from source.

Translating some header files is one thing but building orx (and all it's external dependencies) from source is something that could either go smoothly or not at all.

When building it from source the inline stuff could be dropped (together with fastcall) which would make for an easier conversion of the header files. IF it is possible to get orx to compile.

So... uhm.... duke4e, are you ready to compile orx from source? Have you got msys/mingw installed and are you willing to give it a try?

I'm not too anxious to try compiling it myself because it takes VERY long on my PC to compile a package the size of orx (orx itself is actually not that big, it's the dependencies that 'complicate' the build ).
Merick
Posts: 1038
Joined: May 28, 2007 1:52

Postby Merick » Jan 20, 2010 22:21

Check this thread on the Orx board, someone there has already re-compiled Orx to use stdcall, if you ask they might be willing to send you a copy to work with

http://orx-project.org/forum?func=view& ... id=222#231
v1ctor
Site Admin
Posts: 3799
Joined: May 27, 2005 8:08
Location: SP / Bra[s]il
Contact:

Postby v1ctor » Jan 21, 2010 1:19

Couldn't you just download that orx external archive and copy the libs and header files into the gcc folder?

The libs that it depends on don't use fascall so they don't need to be rebuilt.
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Postby duke4e » Jan 22, 2010 1:20

I've managed to compile basic orx library, but i'm having trouble with compiling additional plugins. I'll post detail results in a few days, since i have trouble with my isp so i cant access internet from home
iarwain
Posts: 22
Joined: Jan 22, 2010 9:45
Location: Montreal
Contact:

Postby iarwain » Jan 22, 2010 10:05

Hi all!

I just found about this site looking at the referring links from orx-project.org. As it's already 5:00 AM here, I hope this post won't be too inconsistent. :)

I'm happy to see your interest in our work and I'd be happy to help as much as I can if you're interested. =)

As for compiling orx, as long as you have both /code and /extern folders at the same level, everything should compile out of the box for any supported system. Well that is maybe beside the makefiles as they might not completely be up-to-date, I need to check. However all IDEs project files should be fine (CodeLite being the main one used for the MinGW version).

You want to compile the "embedded dynamic" versions. Embedded means that plugins are part of the main library instead of being loaded at runtime which makes the linking process far less tedious and gives a good performance boost.

I'd also suggest working with the SVN repository's head version (ie. /trunk) instead of with the last 1.0 release: there has been a lot of fixes and feature additions since the release. The SVN head is as stable as (if not more than) the latest release.

A 1.1 release should come as soon as we have compiled binaries for visual studio 2005: I just recently found someone willing to compile them on his computer as vs2005's cl.exe crashes on mine.

Also please note that you can't use official SFML or Box2D packages to work with orx as they are both different from orx's version. SFML author integrated some of my local changes to the official version but there are still some differences (mainly in fragment shader processing).
I also added 2 features to Box2D in the last week of 2009 which I haven't submitted to its maintainer yet.

I'd be happy to be of any help, either by answering questions or by providing with precompiled MinGW binaries (minus the fastcalls).

Unfortunately I have no experience in FreeBASIC, so I might not be able to help a lot with the wrapping itself. :/

And thanks again for your interest in orx! =)
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Postby AGS » Jan 22, 2010 22:07

@iarwain
I just looked at the great looking demos (included with the mingw tutorial package). Nicely done (things are moving smoothly on my old Celeron machine (1Ghz/Matrox G450 'graphics card')).
iarwain
Posts: 22
Joined: Jan 22, 2010 9:45
Location: Montreal
Contact:

Postby iarwain » Jan 22, 2010 22:48

@AGS

Thanks for your appreciation! The last 2 tutorials have been greatly improved since the latest release though.

2 weeks ago I also released a small game I made for the latest TIGSource (http://www.tigsource.com) compo: it's a small platformer made with orx, written in C++. The source code is included as well as the game+level editor for all mac/linux/windows platforms.
If you're curious, it can be found here: http://gamejolt.com/open-source/games/p ... stew/1369/

[EDIT] Fixed the link. -_-
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Postby AGS » Jan 24, 2010 13:00

Downloaded the game, started it and... crash. Same thing happened when I tried to run some other game. Perhaps the OS/CPU I'm using (Win2K/1Ghz Celeron) are to blame.
iarwain
Posts: 22
Joined: Jan 22, 2010 9:45
Location: Montreal
Contact:

Postby iarwain » Jan 24, 2010 18:50

It might either be orx with Win2K (I haven't this OS at home for testing) or the use of the pixel/fragment shaders I do for this game. :/

Do you happen to get any error message if you start it from the command line?

Actually if you were able to launch the tutorials on the same computer, it's probably the shaders and not orx itself. You can easily deactive them in the .ini files by commenting off with a ';':
- the lines beginning with 'ShaderList'. in data/font/Text.ini and data/MushroomStewData.ini
- the lines beginning with 'WeaponShaderList' and 'ChargeShaderList' in data/object/Weapon.ini

If you are willing to help me finding the issue, I can also put a debug build online for you to test. :)

[EDIT] Sorry for the off-topic, but I didn't find how to send PMs. :/
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Postby AGS » Jan 26, 2010 1:58

iarwain wrote:It might either be orx with Win2K (I haven't this OS at home for testing) or the use of the pixel/fragment shaders I do for this game. :/

Do you happen to get any error message if you start it from the command line?

If you are willing to help me finding the issue, I can also put a debug build online for you to test. :)

[EDIT] Sorry for the off-topic, but I didn't find how to send PMs. :/[/EDIT]


This is what happens. I run the game and it crashes without an error message. To find out what went wrong I decided to run the code through ollydbg. I just ran a trace to see where the crash occurred.

The problem was with orx. A routine in orx tried to execute an SSE2 instruction. And the CPU I am using (Celeron, codename Coppermine-128) has no SSE2 capabilities.

The mingw tutorial worked just fine on my PC so I'm pretty sure that I could compile the game from source successfully.
iarwain
Posts: 22
Joined: Jan 22, 2010 9:45
Location: Montreal
Contact:

Postby iarwain » Jan 26, 2010 19:46

My bad, I completely forgot the MSVS build was set to use these extensions for the math-related modules. :/

If you want to recompile the game with mingw you'll need the latest version of orx. I just released the v1.1, including the mingw precompiled dev package here.

I made all the packages late last night, hopefully I didn't make any mistake! =)
Last edited by iarwain on Feb 04, 2010 7:23, edited 1 time in total.

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 1 guest