Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Steam wrapper, exploring options

  1. #11
    Member
    Join Date
    Apr 2014
    Location
    Lower Saxony, Germany
    Posts
    38
    I guess it's not clearly readable (nested), but Relfos did it just the other way round:
    Code:
    {$IFDEF CPU64}
    ...
    {$ELSE}
      ...
      Asm
        mov myself, ECX;
      End;
      ...
    {$ENDIF}
    Hm, adding that calling convention thiscall would probably make little sense without additional mechanisms for accessing C++ classes. Would be nice if one could declare a whole pascal class as "cppdecl" or whatever, so that somehow the linker would be able to access the C++ classes symbols/properties within a DLL ...

  2. #12
    Member
    Join Date
    Apr 2014
    Location
    Lower Saxony, Germany
    Posts
    38
    I have been asked for an additional listing covering Steam achievements.
    So this is my current unit "steam" which deals with achievements and stats (integer stats only).

    Please note: This only works with the compiler target Win32 for now!

    https://docs.google.com/document/d/10O1GtdrLxHQxYbDQ9KyG5DcGLofBRnRAWFbxprcDcpA/edit?usp=sharing

    The following is a rough game framework in order to show how to use the unit.

    Code:
    program mygame;
    uses
      ...
      steam;
    
    procedure update_event;
    begin
      steam_update;
      ...
    end;
    
    procedure run_level;
    begin
      ...
      repeat
        update_event;
        ...
        if steam_overlay then begin
          if not gamepaused then start_break;
        end
        else begin
          if gamepaused then finish_break;
        end;
        ...
      until quit;
      ...
    end;
    
    procedure mainloop;
    begin
      ...
      repeat
        update_event;
        steam_debuguserstats;
        ...
        run_level;
        ...
      until quit;
    
      if not mission_survived then begin
        incandstore_istat(1); // stat "NumLosses"
        i := get_istat(1);
        case i of
          // died 1x
          1: setandstore_achievement(0); // Lazarus
          // died 9x
          9: setandstore_achievement(1); // cat
          // died 99x
          99: setandstore_achievement(2); // Coyote
        end;
      end;
      ...
    end;
    
    begin
      ...
      if steam_init({your APP ID})=-1 then halt;
      ...
      mainloop
    end.

  3. #13
    Not bad update, that's something at least.

    May i propose that a steam -> c wrapper library could be automaticly generated with including pascal headers in something like a scripting language like php? i had a lot of luck with this for newton dynamics.
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

Page 2 of 2 FirstFirst 12

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
  •  
Comodo SSL