eirexe

Untitled

Jun 30th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.22 KB | None | 0 0
  1. //====== Copyright 2011-2013, EirTeam, All rights reserved. =======
  2. //
  3. // Purpose: Wrapper for Game Maker to be able to use the Steam Api.
  4. //
  5. //=============================================================================
  6.  
  7. /*
  8. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  9. !!!!!DON'T FUCKING CHANGE TABS TO SPACES!!!!!
  10. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  11.  
  12. Game Maker only acepts doubles or strings so I have to fucking work.
  13. */
  14. #include "stdafx.h"
  15. #include "steam/steam_api.h"
  16. #include <string>
  17. #include <sstream>
  18. #define GMEXPORT extern "C" __declspec (dllexport)
  19.  
  20. #include <windows.h>
  21. BOOL WINAPI DllMain(
  22.   HANDLE hinstDLL,
  23.   DWORD dwReason,
  24.   LPVOID lpvReserved
  25. )
  26.  
  27. {
  28.     switch (dwReason)
  29.     {
  30.     case DLL_PROCESS_ATTACH:
  31.         SteamAPI_Init();
  32.     case DLL_THREAD_ATTACH:
  33.     case DLL_THREAD_DETACH:
  34.     case DLL_PROCESS_DETACH:
  35.         break;
  36.     }
  37.     return TRUE;
  38. }
  39.  
  40. std::string RetString;
  41.  
  42. template <typename T>
  43. std::string to_string(const T & value) {
  44.     std::stringstream sstr;
  45.     sstr << value;
  46.     return sstr.str();
  47. }
  48.  
  49.  
  50. GMEXPORT const char * SteamGetPlayerName(char * a, char * b) {
  51.     const char * playername = SteamFriends()->GetPersonaName();
  52.     RetString = playername;
  53.     return RetString.c_str();
  54. }
Advertisement
Add Comment
Please, Sign In to add comment