Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Steamworks pascal headers

  1. #1

    Steamworks pascal headers

    Hi guys!
    As some as you know, I've been working on the first pascal game that will be released on Steam.
    Not sure if anyone else is interested in this, but I hope so, because I want to see more games made in object pascal

    Sadly, all of the Steam API is done in C++, which makes it impossible to be used from other languages.
    Luckly some guys did a wrapper DLL with a C-style interface to be used in C#.
    I wrote a parser that translated those C# headers into a usable Object Pascal unit.

    Here's the link:
    https://github.com/Relfos/steamworks_wrappers

    Later I will also add wrappers to C and Java, as since I already have the code to parse the headers, it is simple to change the code to emit headers in other languages (but Java will need a JNI wrapper).

    Supported compilers:
    Right now I only tested the pascal unit with Delphi 7 and FPC.
    Might work with Delphi XE, if anyone can try it tell me.

    Note:
    You can only use this if you are a registered Steamworks developer, because otherwise the API won't initialize correctly.
    www.pascalgameengine.com - Crossplatform 3D game engine

  2. #2
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    The very best of luck Relfos! I too want to see more games made in Pascal and Steam is a great platform to release on. I have dedicated myself for many years to the goal of creating a modern, production ready engine for use by the Object Pascal community as have your good self and a number of other talented developers that frequent this site.

    You've made great leaps and I'm sure like me, others will be inspired to push on hearing of this first for game development in Pascal.

    Congratulations and let us know when it's released! a major milestone in the fight to have our beloved language accepted as a fully capable tool in game development.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  3. #3
    Thanks phibermon!

    Sadly many people still think pascal is a joke language, almost everywhere in the net I find comments about it...
    Hopefully people like us will continue making nice projects to show that it is very powerful language.

    Now I just wish I had more free time so I could contribute to other pascal projects, especially FPC.
    Also I was now reading the news about the PGD engine, and checked the repo. Maybe I can help a bit with it later, in some months, when I finally release Minimon in Steam, since I will have more time then
    www.pascalgameengine.com - Crossplatform 3D game engine

  4. #4
    That is great news Relfos
    Just curious, what do you use to parse the C++ headers? I would be interested in looking at it if you could share?

    I am really into parsers and stuff like that

    cheers,
    Paul
    Games:
    Seafox


    Pages:
    Syntax Error Software itch.io page

    Online Chess
    http://gameknot.com/#paul_nicholls

  5. #5
    Totally unexpected and really cool.

  6. #6
    Paul, I did not parse C++ but rather C#, a bit easier

    Since the whole API was in C++, to use it from pascal it was necessary to make another dll that wrapped the C++ calls with C.
    So I searched and one guy did a dll like that already, and provided C# bindings for it:
    https://github.com/rlabrecque/Steamworks.NET

    I wrote a mini parser that just extracts the functions, enums and structs (and comments too when possible). Maybe later I'll add it to the rep, in case someone is interested on it.
    www.pascalgameengine.com - Crossplatform 3D game engine

  7. #7
    Quote Originally Posted by Relfos View Post
    Supported compilers:
    Right now I only tested the pascal unit with Delphi 7 and FPC.
    Might work with Delphi XE, if anyone can try it tell me.

    Note:
    You can only use this if you are a registered Steamworks developer, because otherwise the API won't initialize correctly.
    What takes for someone to become Steamworks developer? Do you have to pay anything?
    I'm asking this becouse I myself curently I'm not a Steamworks Developer but I do have access to Delphi 7 and all Delphi versions ranging from Delphi XE2 to Delphi XE7 so I could eventually test the headers with all of them.

    Anywhay after a quick look at the source code I think that the only change that might be required to the code is replace String types with AnsiString types becouse in Delpbi 2009 and newer the string type is an Unicode String. But other than that I don't think there should be any problems in compiling this with newer versions of Delphi.

  8. #8
    Yes, true, probably the only change would be String to AnsiString. But in fact, I think I only used string in some constants, and correctly used PAnsiChar in the others
    I'll change those constants though.

    To become a Steamworks developer, right now it is a bit difficult. You have to pay 100$ to be able to put your game in Greenlight, that is basically a voting area for Steam players. The games with more votes are selected to go into Steam, and then you get an oficial invitation from Valve to become a partner.

    However there are rumors that soon (possibly next year) this will change and possibly the process will be easier allowing more people to get in.
    I think they will remove the voting system and replace it with something else.
    www.pascalgameengine.com - Crossplatform 3D game engine

  9. #9
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    What the *hell* is unicode??

    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  10. #10
    Quote Originally Posted by phibermon View Post
    What the *hell* is unicode??
    Unicode is a modern computing industry standard for the consistant handling of texts (strings) that is not dependant on localized character sets as it contains one universal character set which contails over 110,000 different characters.
    The most common implementation of unicode standard used is UTF-8 where each character can use up to 5 bytes of data to represent each of its characters instead of one byte per character that is used in ansi strings.
    This makes both string types to be incompatible with each other.

    You can read some general thing about Unocde here:
    http://en.wikipedia.org/wiki/Unicode
    To read about some basics about using unicode support in delphi check the article below:
    http://delphi.about.com/od/objectpas...-in-delphi.htm
    And to read how unicode is used in FPC with which you are more familiar check the next page:
    http://wiki.freepascal.org/FPC_Unicode_support

Page 1 of 2 12 LastLast

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
  •