Results 1 to 10 of 15

Thread: Compatibility questions

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    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

    Code:
    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
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  2. #2
    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
    Code:
    {$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.)
    Last edited by User137; 28-04-2014 at 12:33 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •