PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Crossplatform Idea; what do you think?

Hi,

An interesting idea is crossplatform programming. There are some options on the PocketPC.
There's Gapidraw and PocketFrog.
There are a few drawbacks:
* Gapidraw is expensive
* PocketFrog is not finished(not implemented on all platforms)
* They both share the same drawback:
- Only PDA/smartphones and windows are supported!

What if i wanted to create a game supported on Windows, Mac OS 9/10, Linux, PocketPC, Symbian, Palm, Zodiac, NGage, PlayStation etc?

There's no toolkit that supports all those platforms.

Why dont we come up with some standard Game Interface/framework.
That interface should be implemented on all the platforms. The interface would be a GameClas implemented in Standard c++ and would be a layer between eg DirectX and the gameclass.

The game itself should only use the framework and standard c++ functions.

Maybe better; why don;t we just "borrow" the classes from PocketFrog or Gapidraw?

Implementations should easily be tested. The specs of the framework has a test game with it included. A programmer of a framework should test it with the testgame. If it works the framework is well implemented .

This approach would have many advantages:
* A game could be very easily ported to other platforms
* Support for other platforms can easily be added(one should only create the framework on that platform)
* Programm on your favorite platform and just test it on others when the game is finished
* Developers could ask other developers to compile it for them on platforms they dont have
* etc

I've included a little scheme:
1: The game sourcefile. It used only the GameFramework and standard c++. This file should compile on all supported platforms resulting in a working game.

2: the translation step: It;s the framework/gameclass implemented on various platforms in C++. These are just C++ projects that implement the GameClass.
These should be opensource.


3: Just some examples of platforms that support C++



let me know what you think about it
Attachments:
cross.jpg
I think what you are refering to is known as middleware.

A good example of this is Criterion's RenderWare. This allows development of games on the PC, XBox, GameCube and PS2, without having to re-write the rendering code.
mmm, Renderware is a toolkit implemented by a single company. Their framework is not opensource, not free, and it is a produkt, not c++ projects.

What i mean is some specifications/rules that are definined in a standard definition(like HTML has got it;s own specs).

Example; to code for Platform X one should create the following Gameclass:

It should have the following functions:
Code:


//GameClass.h
GameClass {
Blit()
TransparancyBlit()
CreateSurface()
DrawFrame()
CreateSound()
PlaySound()

m_framesPerEec
m_ScreenWidth
m_ScreenHeight
etc

}


This Class(c++) could be implemented on all platforms(maybe on top of PocketFrog/GPP/DirectX,STL whatever) that support standard C++.

The implementation has to translate the class functions to working fucntions on the platform(like directX, OpenGl, STL, GApi).

So when i create an instance of the GameClass om Platform X i know for sure that when i Perform a Blit, a surface would be blitted onto the screen(or surface). When I take the same Code(game.cpp) and copy it to platform Y developement environment i want it to compile and function the same!

Now everyone could write in C++ a game using the implementation of that class.
They simply would include "gameclass.h" and they could compile their game on that platform.


Because every implementation has to follow the rules
of the definition the game source file will also compile in another platform!

The implementation should be opensource so everyone could correct the implementations
The purpose of this thread is:
Why don't w create/come up with some king of game definition?

I am trying to port Kai-Bang to other platforms, but i don;t want to have to investigate every platform!
I just want to:
1 Create game.cpp on the PC
2 Compile it using Visual studio 6.0

3 Drop game.cpp on Embedded Visual studio
4 Compile it to PocketPC

5 Drop game.cpp in CodeWarrior
6 Compile it for palm

7 Drop game.cpp in BuilderX
8 Compile it for Symbian

9 Drop game.cpp in Linux Dev
10 Compile it for linux
etc!

So why dont we come up with some standard framework. I am sure someone could implement the conversion to pocketPC(maybe based om Pocketfrog/Hal).

Someone else could implement it using DirectX on the PC. That would be a nice start.

Than someone on the symbian forums could create a symbian conversion.

Than we would have a nice alternative to Gapidraw(and free).
Later on we could target more platforms(linux, mac-os.
Palm)
SDL is nice if you're looking for portability - performance is another issue, but it's hard (or rather impossible) to concialiate both :wink:

Some links

SDL project http://www.libsdl.org
My SDL tweaks for WinCE http://arisme.free.fr/ports/SDL.php
SDL port for P800 http://dreo.org/p800/esdl/index.html
Mamaich's SDL-emus ports http://mamaich.kasone.com/fr_pocket.htm
I guess it all depends on what you want to do with your time. Either you pay $100 for GapiDraw, and then focus on writing your game for Palm, Pocket PCs, Smartphones, Symbian phones and stationary Windows PCs using GapiDraw, or you can use PocketHAL/PocketFrog for a small sum (a donation) on Symbian, Pocket PCs, Smartphones, Symbian phones and stationary PCs (with Palm support due out soon).

Or you can spend lots of your time researching the least common denominator for all the platforms you mentioned and try to write optimized routines for each (or coordinate a project with members that write optimized routines for each).

IMHO, SDL is very suitable for cross-platform stationary PC development, GapiDraw/PocketFrog for mobile game development, and Renderware for cross-platform game console / stationary PC development. Writing something that combines two or three of the above is a serious task that I unfortunately doubt that anyone could take on as a spare-time project.

Finally, writing a cross-platform graphics middleware is not as fun as it sounds in the beginning. It's a lot of work and attention that has to be spent on the little details, and maintaining a project such as GapiDraw is in the end more about fine tuning than exploration.
Thanks for your insight

I see that there are some game libraries, like gapdraw, pocketfrog, easyCe etc.
Each of them do perform the same task; they all give the developer a Game Framework.

Why isn't there a standard framework? PocketFrog uses
surfaces, so does Gapidraw. Pocketfrog can blit, so can Gapidraw. Why can;t we just have one interface that everyone uses?

Can't we come up with some kind of standard game Header file? So we have one Header file(*.h), but everyone can implement the code the way they want.
Imagine that PocketFrog en Gapidraw would share the same headerFile/functions.
It would be far easier for the developers to swap between both.


THan people could use the same header file, but they could choose between multiple implementations(gapidraw/frog/directx/sdl).


I am sure a talented programmer could code one implementation it in a week or two, especially if he's building it on top of another game library!

So, i am not saying : Let's create a new Gapidraw/PocketFrog/EasyCe.

But i say: Let's create a shared HEaderFile defintion
that translates between all those game libraries
kaiton wrote:
Why isn't there a standard framework? PocketFrog uses
surfaces, so does Gapidraw. Pocketfrog can blit, so can Gapidraw. Why can;t we just have one interface that everyone uses?

There is such a cross-vendor framework, it's called M3D (JSR-184), but built on top of Java, not C++ (especially due to the cross-platform objectives). Thanks to wide vendor support it's also becoming avaliable on many platforms.

Point being: If you really want to do WODM (write once, debug many times) then Java might be the better choice; even without M3D as a 2D gaming platform.

- hm
i looked at java. It's slow:( especially om PDa/PocketPC).
I had considered using something like Allegro ( http://www.talula.demon.co.uk/allegro/ ) in conjunction with some magic code to make a pocketfrog app compile for win/linux/mac... But the magic part is missing.
angedelamort · 09 Aug 2004, 15:03 UTC
java is not really cross platform. Each hardware have their own library and VM implementation. (I'm thinking specifically of cell phones)
If you're talking languages then you ought to take a look at Lua.

Dan East
There's more to this than meets the eye.

You will get into the issue where even the plain C++ you write will not compile properly on all platforms.

Let alone the custom game stuff you write.

Porting is a big job, there is no silver bullet.

It's all very well to say it should be simple, and that's a nice ideal, but it isn't reality as we currently live it.
angedelamort:

"Each hardware have their own library and VM implementation."

Uh .. that's the idea.

As long as the API stays the same who cares what in in the underlying native code.
There's more to this than meets the eye.

You will get into the issue where even the plain C++ you write will not compile properly on all platforms.

Let alone the custom game stuff you write.

Porting is a big job, there is no silver bullet.

It's all very well to say it should be simple, and that's a nice ideal, but it isn't reality as we currently live it.

We have an internal 'framework' that we use to support everything from Smartphones/PPC to PS2/XBox. It does all the great things that you mention, HOWEVER, we spend a huge amount of time creating and managing resources for the various platforms. For example, 3D models and textures that work on a software renderer leave quite a bit to be desired on the XBox... and most anything that looks good on the XBox will not run on a Smartphone. The UI is another area... we have a UI Editor that creates all the UI dialogs, but we find that a console UI on a TV set needs to look and work differently than a touchscreen based PPC UI. Then there are all the different hardware capabilities, memory (or lack of), storage media, processor speed and floating point support, etc. etc.

We do find that our API saves a lot of time and makes life much easier... just not as easy as you would like to think. It does save enough time to pay for itself, so your idea is worthwhile. We would do it again knowing what we know now!

Don't let comments in here scare you away from the project. I've always found devs to be wary of any 'cross platform' talk. In addition, it is usually hard to get devs to band together to make tools. You will probably have to go it alone or with a small group.

Good luck!
Uh ... I can't imagine viable 3d game that will run accetably on Xbox/PC and a PocketPC phone.
GeoffSulcer · 09 Aug 2004, 17:00 UTC
Back when both PocketFrog and GapiDraw were free and constantly being updated with new features, I tried to create a middleware layer that I could use to rapidly switch from one library to the other to evaluate new features and performance.

But, that is where it gets hard; the new/different features. Sure, Blit is straight forward, but PocketFrog had PixelShaders and GapiDraw had Alpha Masks. At the time, GapiDraw had builtin support for fonts, but PocketFrog didn't. You get the idea.

It just became much simpler to pick one and stick with it, working around any shortcomings it may have.

I hope you try anyway, and let us all know how it works out, because it is still something I'd like to have.

Geoff
PocketFrog is still free. And the source code is still all available.
Kaiton: there is already SDL and (even better imo) ClanLib. There is also Allegro and multiple other libraires that does just what you want. Why create just another one?

PocketFrog/PocketHAL and Gapidraw are both tuned to the specific characteristics of handheld devices. These have limited memory and capabilities. You won't get that with huge cross-platform libs.

Your 3-layers architecture also shows how you do not understand PocketFrog. PocketFrog *is* the second layer with PocketHAL as it's first layer. The "Game" framework is a simply class you can use to build the 3rd layer (game).
Thierry wrote:Kaiton: there is already SDL and (even better imo) ClanLib. There is also Allegro and multiple other libraires that does just what you want. Why create just another one?


I am not saying that i want to create another library.
I want to have a layer that's always the same.
I dont care if it;s build ontop of another crossplatform library. I just want it to be possible.
It doesnt matter how great a cross library is,how widely used,etc; its never implemented on all platforms.



Your 3-layers architecture also shows how you do not understand PocketFrog. PocketFrog *is* the second layer with PocketHAL as it's first layer. The "Game" framework is a simply class you can use to build the 3rd layer (game).


Thats exactly my point!!!
Imagine i would have to implement a layer based on PocketHal(or gapi). It would take months! If i would take PocketFrog i could do it in a week or zo.

The same could be said about this:
I want to implement the translation layer ontop of Gapidraw. The same issue here: Gapidraw is allready the game layer above Gapi(like PocketFrog and PocketHal)
Implementing the translation layer on Gapi would take me months. Build ontop Gapidraw i could do it in a week.

The same with Allegro. Building a translation layer ontop of allegro could be done in a week. Build on directX, Vesa,etc it would take months

Why this extra layer?
(The names of the gamelibs are just made up, they just illustrate the points i want to make)


1) Crossplatform platform support
a I dont want to wait until PocketFrog supports Palm (does it allready?), i just want to pick a Palm Game Library, implement the translation layer and compile my game on it.

The same could be said about Gapidraw. It targets Pc's, but why doesnt it support Apple's?
I could however implement the translation layer ontop of apple's gamelibrary "Apple Sprockets"



2)
There's one major advantage on building a game translationlayer ontop of a crossplatform library:
All these layers share the same HeaderFile!
I could create a game on the PC and compile it on other platforms, without commiting myself to one crossplatform company.

3)
Another point: Maybe i like Gapidraw on PocketPC's and Symbian phones. But i got reports of customers that it constantly crashes on the PC version. I want to be able to switch to the Allegro version for the PC.

4)
Another point:Gapidraw has changed it licence(it's a small Price). Johan said Gapdraw would ne Freeware, but it isnt anymore. What if he decides to change his licence?
With a common layer/rules/framework everyone could easily switch.

5) (far-fetched)
What if Tierry disappears? (i certainly hope not). He could decide that computers are dreadfull things and he wants to live on some quite deserted island, far away from computers?



These are just a few thoughts why i think that an extra layer is sometimes a good idea.


I am sure that there are games that are not possible with this approach(3d games) and that a XBox is very different and more powerfull than a simple Palm, but for small games it would suffice.

I think about games like :
kai-bang
Lemmings
Tower Mowgull

Bejeweled

Card games
Minefield

etc

All those games that don;t need 100 frames/sec.
Games that could run on a PDA and on the fastest game console.

I know it would be unpossible to create Doom, Max Payne etc this way but for most of the developers it
would do.
Jacco did some work in this area:
http://www.gamasutra.com/features/20031 ... r_01.shtml

http://sourceforge.net/projects/mobilecore/

(I've not tried it or looked at it much myself).
GeoffSulcer · 09 Aug 2004, 20:00 UTC
Thierry wrote:PocketFrog is still free. And the source code is still all available.


Which is precisely why I gave up trying to have a middle layer to use either library and now use PF/PHAL exclusively. :)

Geoff
refractor wrote:Jacco did some work in this area:
http://www.gamasutra.com/features/20031 ... r_01.shtml

http://sourceforge.net/projects/mobilecore/

(I've not tried it or looked at it much myself).

According to sourceforge statistics, I'd say this project looks dead. Do you know if there's still any development going on?

- HM
Hi Kaiton,

I have to respond to some of this...

It (GapiDraw) targets Pc's, but why doesnt it support Apple's?


I could give you tons of reasons why we didn't port GapiDraw to OSX. I run three Apple computers myself, including a G5 and a PowerBook. Sprockets have not been supported since OS9, and only exists as a "hack" to get some games like DiabloII working under X. The reason GapiDraw was not ported however is simply that why on earth would anyone want a handheld-optimized software-rendering 16-bit 2D library running under OSX (not me that's for sure)!

Another point:Gapidraw has changed it licence(it's a small Price). Johan said Gapdraw would ne Freeware, but it isnt anymore. What if he decides to change his licence?


Buy GapiDraw now and you have a license. It's as simple as that. And it won't get revoked. Buy a site license and you'll get free updates for a year. Sure, prices may change some day. But we will announce such raises in advance so that buyers can purchase a license for the current price if they have been "saving up" for a new release.

Another point: Maybe i like Gapidraw on PocketPC's and Symbian phones. But i got reports of customers that it constantly crashes on the PC version.


GapiDraw has been tested on literally thousands of stationary PCs, and it has been used successfully in products such as PocketWar which is available for Win95, 98, 98SE, ME, 2000 and XP. Most GapiDraw developers also depend on the stationary PC version for their primary development needs. I am most certain that the issues you experienced on a stationary PC is not related to GapiDraw.
Johan,

First of all, to correct things:
I think Gapidraw is on of the greatest products on the PocketPC scene.

I think the Price of Gapidraw is quite good(everyone can spend 100 dollars)

I never experienced crashes on PC's with Gapidraw


These points were just samples of why i would like to see a intermediate layer => I dont want to commit myself to one company. I appoligise for the misunderstanding.

Who needs a handheld optimized engine on MacOsX?

I dont want it either. Thats why i want to have that intermediate layer!

I want to program a game with the layer. Compile it for PocketPC using Gapidraw and compile it on MacOSX with a MacGameLibrary

So in short:
I dont want to create a new gamelibrary, I want a intermediate layer above the gameLibraries, so i can
1 easily switch between GameLibs
2 Target more platforms than would be possible using one GameLibrary
Kaiton, you are suggesting building a new lib and at the same time you say that you don't. That doesn't make much sense.

PocketHAL *is* a layer on top of different APIs (GAPI, Direct Access, Symbian UI and so on).

GapiDraw *is* in part a layer on top of different APIs (GAPI, Direct Access, Symbian UI and so on). But it is also a library that provides drawing primitives (like PocketFrog).

SDL *is* a layer on top of different APIs.

ClanLib *is* a layer on top of different APIs + advanced drawing primitives.

Allegro *is* a layer on top of different APIs + advanced drawing primitives.

Why you would want to wrap them all with another abstraction is beyond me. It would be much easier to just use an existing one.
damn, its difficult to say when my english is not quite good:(

I try it one more time:
Allegro, PocketFrog , gapidraw are Game Frameworks.
They all give the developer a framework to make a game. With it one could blit surfaces, sprites, backbuffer handling etc.

Why do i wanna have a new layer?
Imagine i have created 5 games. There's a new Computer
PearX. Someone Build a great GameLibrary(like PocketFrog) on PearX. Imagine i wanted to port all my games to PearX

Your Suggestion(Use PocketFrog):
What if i used PocketFrog to create 5 games and i wanted to target PearX? I would have to recreate all those games with another GameLib for PearX.

What if I used the translation Layer build ontop of PocketFrog? I only whould have to build the translation layer on PearX using a GameLib fo PearX.
Because someone else had allready created a great GameLib for PearX i just have to create the layer in that GameLibCreating that layer would take me a week for one game, but for the other four it would just take a day(because the PearXLayer is allready finished).
I think what you are talking about is simply a game engine and/or an abstraction in your game to use different APIs.

Although this is definitely a good idea, it's impossible to come up with a generic solution that will be useful to all games.
Thierry wrote:I think what you are talking about is simply a game engine and/or an abstraction in your game to use different APIs.

Although this is definitely a good idea, it's impossible to come up with a generic solution that will be useful to all games.


mmm, PocketFrog is also a gameLayer and it's suitable for most of the games i can think of.
It's just a matter of how detailed one would make the translation layer.

Lets for example take PocketFrog. That too is a way to different API's/multiple-platforms

Imagine we would be PocketFrog as the standard(thus the translation layer)? The Pocketfrog definition would be an excellent translation layer!
PocketFrog has allready proven itself(like Gapidraw).
It's used in loads of games. It proves that it is generic enough to create lots of games.

Now,
If I would implement PocketFrog on top of Allegro on Linux i could target PocketPC AND Linux.
If someone would implement PocketFrog on MacOsX using allegro i could target PocketPC, MacOsX, linux etc!


Why PocketFrog ontop of an other GameLib? Because it's simply a lot easyer to program than coding hardcore blits etc (one could dothat too if they want)!


What if the PocketFrog-definition would become the standard for 2D programming(just like c++ is a standard). Than people would know that even in the future their game would compile, on all the platforms, because the defintion is a standard.
This post is not really on topic though,

MY PENGUIN IS NOT THE LINUX PENGUIN!!!!!!!

I made him before I knew anything about linux, and possibly before a penguin was thier mascot.

Ok...
Sorry, about that, just had to rant.

Back to the normal discussion...
Kaiton, in this specific scenario you describe, it simply means porting PocketFrog to other platforms.

So in essence what you want is a cross-platform library (hence the very subject of this thread). I already listed different librairies that *already* do what you want.

Your suggestion of wrapping existing librairies is in essence to build an abstraction on top of existing abstractions. A concept that only adds overhead (speedwise, memorywise, programmingwise and debugging wise) for no substantial gain.

If I were you I would simply pick one of SDL, ClanLib or Allegro (they already run on tons of platforms) and simply add a PocketHAL driver. This way you would have what you want with minimal effort.
Pejo Software - Per · 10 Aug 2004, 20:51 UTC
I am not completly sure that it is as simple as just adding a PocketHAL driver to those libraries. You would also probably need to remove global/static variables for symbian, provide image loading etc...

I also wonder how performance is with for example SDL when for example blitting with constant opacity GapiDraw and also my own framework are able to do this working with 2 pixels at the same time.

Anyway, the effort of making a framework that will be able to run on any platform without is a task that should not be underestimated.

Another question you might want to ask yourself is whether the market is big enough for the effort required. Will you be able to sell that many games for Apple / Linux?

I would actually also want to see a library that is free and easy to use and optimised for every platform there is, but I think that the chances for that to happen are very small.
Of course you will run into all kind of issues. Each platform has it's own set of limitations. The more platforms you support, the more limitations you have to deal with. Supporting lot of platforms isn't necessarely a good thing.

This is why PocketHAL concentrates on handheld devices. This way the limiting factors are similars and they drive the design.
It seems to me that a lot of what your talking about wanting to do can be done just by the way you architect your own application...

For instance, the way I'm doing my current game is in a whole bunch of very small, discrete units of work. I've taken a very object-oriented approach to things, even though I'm not actually doing everything as classes and object (i.e., it's a lot of procedural code, some classes, a mix of concepts). What this allows for is having small pieces of code to port rather than the core logic of the application. Note that I haven't invented any great strategy here, this is how cross-platform work is generally done.

In other words, rather than call GapiDraw's BltFast function, I instead call my own DrawImage function. I pass it a simple set of parameters (Surface*, x, y, opts) where opts is a custom struct. In this way, if I want to switch to a different library, I just modify that DrawImage function, nothing else gets touched. Same for file I/O, sound functionality and control I/O, it's all very atomized code.

Likewise, my main game loop is not GapiDraw's main loop. I call a function FROM GapiDraw's main loop, but it's not tied in any way to GapiDraw itself.

Really, doing cross-platform code is fairly easy, it's the WORA concept that usually gets in the way because doing that is virtually impossible without some sort of VM foundation, and that doesn't generally fly well for performance in games (even what I'm doing has performance implications, but done smartly they are acceptable).

I think the bigger issue is resources... Designing a game that will run well on a SmartPhone screen as well as a PC screen as well as a Palm device, all with different resolutions and such, seems to me quite a nightmare (I've abandoned the idea of a SmartPhone port of my current project because it simply won't work on that small a screen real-estate, same for cell phones). Even just thinking of varying memory footprints, things like sound becomes quite an issue because you can just use straight WAVs so as to not have to deal with audio codecs of any sort, but then your talking much more memory, and that won't fly on many limited devices.

But, now I'm off on one of my prototypical tangents :) My point is that just by coding your app with a procedural/OO mentality, you can get 98% of the way towards your goal. Incidentally, I'd try and stay away from C++ just because it's somewhat less portable than straight C is. But again, if you've broken your app up into a number of small pieces, porting it should be a lot easier, regardless of C vs. C++ or whatever libraries you choose to use.
Fzammetti is exactly right. I don't call GapiDraw or a sound engine or anything like that. I call my own functions, which in turn call those functions.

You can see the exact same technique at work in the GPL source code for Quake 1. Quake essentially has its own API, with very few points of contact with the outside world.

The software engineering principle at work here is high cohesion, low coupling.

So the first thing you have to stop doing, to be more cross platform, is spitting out files, sucking in resources, and groping the registry from the bowels of your code.
Thierry wrote:I think what you are talking about is simply a game engine and/or an abstraction in your game to use different APIs.


Fzametti and Mlepage are expressing exactly what I meant.
The funny thing about this is that at work I go out of my way to achieve this ideal, and in getting everyone else to work that way, because it makes for a high degree of reuse and efficiency gains down the road. I'm a big believer, especially in the business world where I earn a living, that the less tightly coupled the various pieces of your systems are, the more you will be able to (a) maintain and modify that codebase (and distribute the workload) and (b) gain more by being able to take a piece here and a piece there from one system and then another, cobble them together to serve the customer better, faster and ultimately cheaper. I've been pushing Web Services as the model for this since BEFORE they were a buzzword! (sadly, uptake hasn't been as swift or far-reaching as I'd have hoped). But I digress...

The irony here is that when I do PPC programming on my own, for some bizarre reason I usually fail to think this way completely! I've had to actually force myself into this mindset with my current project, and even there I can see places where I clearly broke my own rules! Part of it is that 99% of my workday is Java-based, where you are pretty much forced to work the OO way, and I'm so fluent in that arena that it's second nature, but with C/C++, my level of expertise isn't at that level, so I still impress myself when I just get something to work, let alone having done it "right" :)
To me it's also a risk management thing. I want to reduce my dependencies on third party code.

This insulates me from API changes, and if necessary, I can swap out the entire third party library.

A good (though older) book for this is John Lakos' Large Scale C++ Software Design.
mlepage wrote:
I want to reduce my dependencies on third party code.
This insulates me from API changes, and if necessary, I can swap out the entire third party library.
And you could even change the platforms you;re targetting!

fzammetti wrote:

For instance, the way I'm doing my current game is in a whole bunch of very small, discrete units of work.

In other words, rather than call GapiDraw's BltFast function, I instead call my own DrawImage function. I pass it a simple set of parameters (Surface*, x, y, opts) where opts is a custom struct. In this way, if I want to switch to a different library, I just modify that DrawImage function, nothing else gets touched. Same for file I/O, sound functionality and control I/O, it's all very atomized code.

Likewise, my main game loop is not GapiDraw's main loop. I call a function FROM GapiDraw's main loop, but it's not tied in any way to GapiDraw itself.



mleplage wrote:
I call my own functions, which in turn call those functions.


That's exactly what i meant in the first place;
You both introduced a "translation layer" above Gapidraw.

Now imagine you gave those translation functions(like your DrawImage) to me. I am a great fan of Linux. And i would implement your functions in c++ on linux.
Than i would give my port to you and the docs how to set it all up(what libs to use etc). Now you could, without investigating Linux(a lot), compile your games on linux.


Now, if your layer was a standard, than everybody could port it to other platforms. Because these ports would be build ontop of other gamelibs people wouldn't have to concentrate on optizing blits, optimizing rotates etc. They know they are optimized because the simply call optimized functions of the gamelib underneath

The MainGoal is that all those ports would be availlable for free(opensource). Whatever port i would take, i'd know that my game source would compile, on any platform.

In short;
You both are doing the same thing; creating a layer above Gapidraw to be able to switch easily between gamelibs. These layers are doing similair things, blitting, flipping etc.
If you had working together, or used the same definitions you could have spared a lot of time.
Now if a third person had joined and used linux, you could have also compile it for linux(and target a larger audience)
kaiton wrote:
In short;
You both are doing the same thing; creating a layer above Gapidraw to be able to switch easily between gamelibs. These layers are doing similair things, blitting, flipping etc.
If you had working together, or used the same definitions you could have spared a lot of time.


Personally I prefer doing the layer code than sharing it. If I do it I know exactly how it works and which problems can arise, and fits exactly the programming and design style I have.

If I'd share it I'd have to fit other people's design and programming style

I think I'm a lot more productive using my own layer than using somebody else's one, no matter if I need 10 days to do it for every platform I want to support. And I feel 10 days is really a long time, I ported my 3d game from gapidraw to pockethal in a few hours, and I don't expect to need more than 2 or 3 days to port my 2D game from pocket pc to palm ( the T3 should arrive today! :)_ ) , and some days more for the 3D engine, due to the code optimization and the armlets thing (which anyway I'd have the same problems if I had that "multiplatform" framework)



anyway of course it's just my opinion, you're free to do whatever you want ;) however I think it's a weird thread, I don't know if you want to convince everybody that it's the way to go, or if you're seeking for help/colaboration to do it :)
Well, here's a suggestion... Since we now know what your talking about, and we also understand that your not really talking about writing any real code, why don't you go ahead and spec out such an abstraction layer and post it here?

Then we can all tell you what's wrong with it and why it won't work for case X, Y and Z :)

(Welcome to the world of Enterprise Architecture!, except that we retain the choice of using what you create or not)
But if we create another layer, I'll then have to make my own layer on top of that. You see, I don't like being so tightly bound to a third party product. Using the API is being tightly bound.

Additionally, you will find that not everyone agrees on how the API should be. People have different preferences and coding styles, and this is reflected in the API. Also people have different interests and priorities. Some are going to be all about pixel shading and image loading while others will want more control over the timing and event loop.

I'm confident Scalene's API and implementation are quite different from PDAmill's. This isn't necessarily bad BTW.
All valid points. But, the orignial poster was proposing the idea, so I was just laying down the challenge that since it only involves writing up some function prototypes and drawing up some UML, why not go for it?

Any stand, all-encompassing anything will almost by definition have to cater to some lowest common denominator. *I* personally wouldn't use what he's proposing for no other reason than I understand the underlying concept and can do it myself. I prefer writing my own code whenever possible, so long as it doesn't take so much time as to not be worth it (like using GD instead of completing my own library is worth it to me), I do so. This is a prime example.

No one here is disagreeing that an abstraction layer is, generally speaking, a good thing (tm). All I'm saying is that rather than continuing to debate that (and there's really no debate!), why not go ahead and spec it out so we can really argue about something concrete :) (relatively speaking anyway)

*I'M* not going to do it, but I think the original poster now has a clear idea of what to do, he should go off and do it and come back when it's done. Maybe he'll pull it off and we'll all say "wow, I didn't think of that, I'm going to use that!". More than likely though we'll say "not bad, but here's a list of reasons mine is better, or I'm just not going to use it anyway because..."