[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Accessing C++ libs with ctypes



A->B is shorthand for (*A).B , so
have you tried something like SteamUserStats().contents.RequestCurrentStats() ? Just thinking out loud here.

Rob

Sent from my Cyanogen phone

On 10 Nov 2015 00:52, Bartosz Debski <bartosz@xxxxxxxxxxxx> wrote:
Hi All,

I know this is not directly pygame related question but I'm looking for help from more c++/Python able.

I'm trying to get some use of Steam libraries which are C++. I have managed quite easily to load Steam library and initialize it with use of Python ctypes (Steam lib returns loaded Steam App)

Now as I'm trying to get more useful information from documentation, all is in C++ and all references are C++.

eg:
"
At the beginning of a game session, call SteamUserStats()->RequestCurrentStats() to fetch the user's data from the Steam back end. You will receive a UserStatsReceived_t callback when the data is ready.

Use SteamUserStats()->GetStat() and SteamUserStats()->GetAchievement() to iterate the data and initialize game state.

Use SteamUserStats()->GetAchievementDisplayAttribute() to retrieve human-readable properties of the achievement, including its name ("name") and description ("desc"). These properties are localizable on the Steamworks Partner Website, and the returned data varies with the language in which the user is running the game. You can also get an achievement's icon using SteamUserStats()->GetAchievementIcon() or the time each achievements was unlocked with SteamUserStats()->GetAchievementAndUnlockTime() "

Now, as i can call SteamUserStats() without problem, I cannot figure out how to call "sub functions" likeÂSteamUserStats()->RequestCurrentStats().

Can someone kindly explain how to translate such call teamUserStats()->RequestCurrentStats() to python with ctypes ?

As you can see it's game related to a point :)

Cheers