PDA

View Full Version : Compatibility questions



Mirage
26-04-2014, 07:26 AM
Compiler compatibility:
1. FPC which version (2.6.2, 2.7.x, latest trunk)?
2. Delphi which version (7, 2007, XE, XE6)?

GAPI:
3. OpenGL 3/4?
4. Require OpenGL ES 2 or 3 hardware?

Audio?

My thoughts:
1. FPC 2.7.x
2. Delphi XE
We can use unicode and generics.
3. OpenGL 4.x - there is compatibility with older hardware I think?
4. GL ES 2 - most hardware is not capable of GL ES 3 yet.

AthenaOfDelphi
26-04-2014, 09:16 AM
I don't disagree with anything other than the Delphi... if we don't aim to support XE5 or XE6 then I think we'd be crazy to be honest. These are the versions that really bring the cross platform capabilities alive. I for one want that.

Realistically, based on a project to port an old Delphi 5 codebase to Delphi XE2, the biggest issues are the string handling. If we code for unicode right off, that shouldn't present a problem and then it's down to how much use we want to make of exotic language capabilities like attributes, overloading, generics etc.

Mirage
26-04-2014, 10:14 AM
These are versions which we'll use to test on.
Correct me I'm wrong but if code can be compiled by Delphi XE it should be compiled by Delphi XE6 too.

AthenaOfDelphi
26-04-2014, 10:18 AM
In theory yes, but it all depends on the language features. The big string compatibility problem came in with D2009, but since then they've been adding a lot of new language features.

The biggest problem is access to compilers. I have access to D5, D2009, XE2 and XE6 (MVP licence) so they'll be the platforms I can support.

SilverWarior
26-04-2014, 01:20 PM
In theory yes, but it all depends on the language features. The big string compatibility problem came in with D2009, but since then they've been adding a lot of new language features.

There was is quite big difference between Delphi XE and Delphi XE2. Main difference is introduction of Namespaces in Delphi XE2 and moving some function into different units.
Now I haven't encountered those problems myself since I used Delphi XE trial version just for quick testing to see what is new since Delphi 7 which I was using before. I then waited a bit for Delphi XE2 to come out and bought that. So I never had to do Delphi XE to Delphi XE2 code porting.
But I read quite many complaints of other pepole about this.

I'm afraid that biggest problem will be LVVM compiler with ARC support that was introduced in Delphi XE5 for MacOS, iOS and Android platform. This introduces several big changes like "weak referencing", calling SomeObject.Free is equal to SomeObject := nil, DisposeOf method to force object destruction, etc.
I'm actually afrad that becouse of these changes we might even need seperate souce codes or heavy use of ifdefs.


The biggest problem is access to compilers. I have access to D5, D2009, XE2 and XE6 (MVP licence) so they'll be the platforms I can support.

Wait doesen't owning of newest version of Delphi grants you acces to all older versions all the way back to Delphi 7?

de_jean_7777
26-04-2014, 02:19 PM
1. 2.7.x (later 2.8.x)
2. Problem, I don't own Delphi, and I don't think I could afford it right now. Also, considering the price and how often new versions come, I don't think I'd want to.
3. The same code base could support 3 and 4, as well as GLES. There are differences, but with a bit of abstraction it should be possible to support everything.
4. Supporting GLES 2 would be benefitial due to the many devices that support it.

dj_sharp
26-04-2014, 02:29 PM
Not sure if targeting trunk FreePascal compiler is a good idea, I would rather target stable branch.

I believe that the problem with Delphi is not only its price, but also that it only got worse over time since Delphi 7 in 2001

AthenaOfDelphi
26-04-2014, 02:41 PM
Making a community project is one of the good things... between us we should be able to target the main compilers that we all want to use. One big advantage over being a solo developer :)

Mirage
26-04-2014, 02:42 PM
We need our code to be compiled with Delphi and FPC.
So we can use some subset of language features. We should decide which.
FPC in Delphi mode doesn't support all the features of latest versions (and probably never will).
Personally I'm satisfied with Delphi 7 language features, plus:
1. unicode (D2009, FPC 2.6.2)
2. generics (D2009, FPC 2.6.2)
3. unit namespaces (D2007, FPC 2.7.1)
As I know generics are usable starting from Delphi XE.
We'll need to test various code with generics to check if FPC and Delphi are consistent on that.

And I'd to avoid usage of ifdefs or separate units where possible.

Stable FPC 2.6.2 is very old.
FPC 2.7.1 is pretty stable.

Cybermonkey
26-04-2014, 02:59 PM
Sorry to call in, but stable FPC is 2.6.4 ... since it wasn't mentioned before I thought to make a notice about that.

pitfiend
26-04-2014, 06:31 PM
I think we could make it language neutral, leaving all that stuff about big strings and unicode in a separated group of units, with helpers to display the correct strings based on error codes or something like if needed.
As generics are not well supported on fpc I think we should avoid them too, specially if we plan to cover all the delphi family as well as the fpc one.

AthenaOfDelphi
26-04-2014, 07:59 PM
Would a better thread be... what language features should we avoid?

Carver413
26-04-2014, 08:06 PM
I think we could make it language neutral, leaving all that stuff about big strings and unicode in a separated group of units, with helpers to display the correct strings based on error codes or something like if needed.
As generics are not well supported on fpc I think we should avoid them too, specially if we plan to cover all the delphi family as well as the fpc one.
I agree with this, and would add that if the true intention of this project is to rebuilt the comunity then the best chance is threw new members wanting to learn and they will be using fpc not delphi.

code_glitch
26-04-2014, 10:14 PM
If we plan the architecture well, or are clever with compiler switches I think we could emulate a system similar to the gallium developers. In other words have multiple backends which target different systems which can be worked on by people with expertise in that field. I have a system like that for the Prometheus library that when compiled for linux uses my X11_Window unit, for win32 uses my WINAPI_Window unit and for anything else uses my SDL_Window unit for event/window handling. Each unit basically translates a Prometheus call into the relevent OS level calls. That way, as a user I can do



CreateWindow(640, 480, 32);


And the compiler will automatically compile the appropriate code for the target system. If I recall this is similar to the gallium project as they have an implementation for each standard and that plugs into their actual driver code. So they implement OpenGL once, OpenCL once and even D3D once and to add enw hardware they just write the hardware specific stuff in the layer under.

Also, I dont have delphi so any code I would work on would be FPC. I also agree with the decision for using 2.6.4 as the current stable version. As for graphics, OpenGL3 and 4 seem like a good choice. As most of my work has been with OpenGL 2.1 I'd be happy to convert some of my implementation from the Prometheus library to supply a 'compatibility mode' for the engine :)

Edit: Forgot to mention this, but the prometheus code has texture handling, FBOs, context creation, extension loading, basic 3d support and I'm working on an HLSL implementation :). It uses Benjamin Rousseaux's rather excellent TGA and PNG loaders for image loading :D

User137
28-04-2014, 12:29 AM
So few language features to leave out from coding insides are generics and operator overloading. But for the game programmer that uses the engine, we can make more features available via IFDEF's. This is 1 example

{$IFDEF fpc}
operator +(const a, b: TVector2f): TVector2f;
operator -(const a, b: TVector2f): TVector2f;
operator *(const a, b: TVector2f): TVector2f;
operator *(const a: TVector2f; n: single): TVector2f;
operator /(const a: TVector2f; n: single): TVector2f;
{$ENDIF}
But we'd have to define it a little better than just 'fpc', because if we do support older than 2.7.1 it wouldn't compile on them. So it can be changed to something like {$IFDEF OpOverload}

(But these are things we don't necessarily need to focus at all, except at much later time when things are already working. They're just a bonus, nothing to do with how engine works.)