Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //====== Copyright 2011-2013, EirTeam, All rights reserved. =======
- //
- // Purpose: Wrapper for Game Maker to be able to use the Steam Api.
- //
- //=============================================================================
- /*
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !!!!!DON'T FUCKING CHANGE TABS TO SPACES!!!!!
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- Game Maker only acepts doubles or strings so I have to fucking work.
- */
- #include "stdafx.h"
- #include "steam/steam_api.h"
- #include <string>
- #include <sstream>
- #define GMEXPORT extern "C" __declspec (dllexport)
- #include <windows.h>
- BOOL WINAPI DllMain(
- HANDLE hinstDLL,
- DWORD dwReason,
- LPVOID lpvReserved
- )
- {
- switch (dwReason)
- {
- case DLL_PROCESS_ATTACH:
- SteamAPI_Init();
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
- }
- std::string RetString;
- template <typename T>
- std::string to_string(const T & value) {
- std::stringstream sstr;
- sstr << value;
- return sstr.str();
- }
- GMEXPORT const char * SteamGetPlayerName(char * a, char * b) {
- const char * playername = SteamFriends()->GetPersonaName();
- RetString = playername;
- return RetString.c_str();
- }
Advertisement
Add Comment
Please, Sign In to add comment