PDA

View Full Version : Today's C++ cross-platform game engines


Tertsi
11-14-2005, 02:06 AM
I'm looking for a great cross-platform (at least Windows and Mac) 2D game engine or game "library" with C++ source code.
It should be reliable (no betas or alphas) and use DirectX 7 for Windows and OpenGL for Mac/Linux.

There's PTK and Torque 2D, but they aren't what I'm looking for. (PTK mainly because it doesn't come with source code and because its sound library can only support two speaker systems.)

Currently it seems that unless there's some such engine that I haven't noticed and no one will license their own engine to me, I'll have to roll my own, derived from the PopCap framework.

ManuelFLara
11-14-2005, 02:22 AM
It's a real pity the PopCap Framework isn't cross platform, since it's great. I'm using it at the moment and I guess I'll eventually branch it and do a mac version replacing the system and DirectX stuff with calls to PTK, since I don't want to mess with Mac OS X API or OpenGL directly.

Jack Norton
11-14-2005, 02:35 AM
There's PTK and Torque 2D, but they aren't what I'm looking for. (PTK mainly because it doesn't come with source code and because its sound library can only support two speaker systems.)

Lol well I don't see why you would want to use more than 2 speaker systems, but... :)
(I mean doesn't seem to me a valid reason to discard it).

Tertsi
11-14-2005, 02:40 AM
I'm not planning to use it on indie games alone... The engine can't have such flaws. (Though not providing source code is the much more important flaw with PTK.)

EDIT:

Forgot to mention:

I asked:

'The Popcap framework does this thing... If you make an image out of a
258x256 bitmap, it will actually create several textures to hold it--
like a 256x256 texture, then a 2x256 texture, and draw them both.

I'm wondering if PTK does the same.'

Patrice answers:

"No it does not. You have to prepare all your graphics correctly before
working with them. ( you can use rectangular textures that works too )"

svero
11-14-2005, 04:58 AM
I think Pat should seriously consider giving the source with PTK. Can't really see any downside and it would probably go a long way to making his the engine of choice.

Jack Norton
11-14-2005, 05:03 AM
Tertsi, don't tell me you even believe other fables like:
- max 5mb download
- 256 colors
- piracy doesn't affect your sales

and other magic statements of our beloved Pavlina? we're in 2005, wake up pls :D

Just to support my theory:
Atlantis and Fairies use 1024x1024 textures. They Sold THOUSANDS, they're on every portal possible. Their filesize is 10+mb. Still thinking is essential to have 256x256 textures... :eek:

Another thing, I just tried PTK DX on my girlfriend ultra-crap Pc with intergrated S3/VIA card of 8mb. Is a 5 years old pc. Magic Stones (my most resource-consuming game) works perfectly...

Tertsi
11-14-2005, 06:13 AM
No, I don't think games have to be less than 5 MB and I definitely wouldn't ever make a 256 colour commercial game. It isn't about hardware requirements, but convenience. You can have any image size you want (thus you also save a bit in file size because larger images can be more compressed) and you don't have to worry about them.
I'm also sure that piracy affects sales, I'm only 100% sure about the players that I know though.

1024x1024 textures require 4MB+ video card, so that can't do much harm.

Kestral
11-14-2005, 06:20 AM
An Open Source C++ IDE and compiler:

Dev-C++ (http://www.bloodshed.net/)

After you install Dev-C++, use the built-in package manager to get and install:

Simple DirectMedia Layer (SDL) (http://www.libsdl.org/index.php)

SDL is an Open Source API that is cross platform. I use it for 2D projects. It also does 3D via OpenGL, but I have never used it for 3D.

Tertsi
11-14-2005, 06:25 AM
SDL doesn't use DirectX 7 for Windows.

dima
11-14-2005, 09:20 AM
OK, I would like to add that SDL is not a bad solution at all. It is cross platform, can do 2D and all the system stuff, plus audio. Everything you really need is there. SDL does use DX (ddraw 5?) under windows to blit 2d. Also it is possible to use your own renderer for 3D acceleration. OpenGL is native, and DirectX can be used almost just as easily.

Most engines I find either lacking in performance, or not shipping with source code. BlitzMax has the right idea but I like coding in C++, other libs like PTK don't show the source and don't batch geometry for instance. SDL does all the good stuff, you just have to plug your own renderer.

ggambett
11-14-2005, 10:41 AM
SDL does use DX5 to do 2D blits but it can't do hardware accelerated rotated sprites anyway.

FWIW, I found a way to interface SDL and Direct3D 7, so most of my sprite engine is now based on SDL (event processing, image loading, pixel format conversion, font rendering, sound, ...) and has a pure SDL software renderer (all platforms), a SDL+OpenGL renderer (Linux and Mac), and a SDL+Direct3D renderer (Windows).

Tertsi
11-14-2005, 11:25 PM
ggambett, could you somehow enlighten how you managed to do that?
I also don't find anything that mentions DDraw 5 in the SDL 1.2 docs. ?

ggambett
11-15-2005, 06:19 AM
DX5 is completely "under the hood" in SDL so you won't find it in the documentation, but it's right there in the source.

About DX7 + SDL, it's just a matter of opening a SDL window forcing the use of the windib driver, getting the handle for the window SDL just created, and opening Direct3D then.

Robert Cummings
11-15-2005, 08:24 AM
There is a version of the popcap framework for the mac but the guy who developed it (based of quickdraw so it's software) is keeping a tight hold on it and I do not blame him because conversions of popcap titles are his business.

I have been down the popcap route, and the T2D route and also tried PTK, however I have a preference for blitzmax due to it's almost-c++ speed and versitility.

It has just been updated to 1.12 including a full cross platform gui lib. I do think it's the best cross platform solution out there. If you like, you can also use C++ with it. Did I mention the integrated LUA as well?

Guess I'm slowly liking it...

Emmanuel
11-15-2005, 08:47 AM
I've never needed access to the ptk sourcecode (even though I do have access to it and contributed some extensions like resource packing) while developing Atlantis and Fairies. Quite the opposite - not being tempted to mess with the engine has helped with my productivity and code reuse. I've grabbed a lot of code from Atlantis and put it in Fairies; the engine was unmodified so I didn't have to make any changes.

Best regards,
Emmanuel

Tertsi
11-15-2005, 10:07 AM
Well I'm 100% sure that I would need access to it.

Gnatinator
11-15-2005, 10:41 AM
PTK is -very- robust and simple to use. It does pretty much everything for you in a very simplistic fashion. And if you need something or a bugfix, pat is usually quick to fix it up.

Opensource would be a plus, but I don't see it as a necessity in most cases, especially if you are creating casual games that don't require special tech.