Skip to content
The official GameSparks C++ SDK for Cocos2d
Branch: master
Clone or download
Latest commit 05aa664 Feb 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Creating initial file from template Feb 18, 2019
GameSparksSDK Initial commit. Feb 19, 2019
GameSparksSample Initial commit. Feb 19, 2019
CODE_OF_CONDUCT.md Creating initial file from template Feb 18, 2019
CONTRIBUTING.md Creating initial file from template Feb 18, 2019
LICENSE
NOTICE Creating initial file from template Feb 18, 2019
README.md Initial commit. Feb 19, 2019
build_sample.py Initial commit. Feb 19, 2019
install_dependencies.py

README.md

Gamesparks Cpp Cocos2dx

The official GameSparks C++ SDK for Cocos2d

Prerequisites

OS X

  1. XCode

Windows

  1. download and install python 2.7 (only required on windows)
  2. Visual Studio

running the sample

  1. execute install_dependencies.py. This will install a copy of cocos2d-x.
  2. Open one of the project file located at GameSparksSample/proj.* in you IDE (note that the Android Studio project does not support building from inside the IDE unless you specify cocos as external build tool as described here: http://discuss.cocos2d-x.org/t/how-can-i-use-android-studio-together-with-cocos2d-x-any-hints/7365)
  3. Open Sample/Classes/AppDelegate.h and change the credentials near line 84
  4. compile, run

Alternatively you case edit Sample/Classes/AppDelegate.h in any editor and execute build_sample.py

Integrating the SDK into your project

  1. Copy the GameSparksSDK directory into your project
  2. Add the source files to your project: 2.1 Either add all the .cpp, .c and .mm files located at GameSparksSDK/src/** to your project 2.2 Or add GameSparksSDK/src/GameSparksAll.cpp to your project. 2.3 On iOS and macOS you'll also need to add GameSparksSDK/src/GameSparks/GSIosHelper.mm and GameSparksSDK/src/UNIX2003_Fix.c
  3. Add GameSparksSDK/include to your include search paths

One thing to note is, that the SDK is not thread-safe. So you have to do locking yourself. However the SDK only ever calls any callbacks from within a call to Update(). So you always know which thread is calling your callbacks.

Real-Time Services

The sample uses the GameSparks Real-Time Services have a look at the tutorials for the Real-Time Services. The API of the C++ SDK is very simmilar to the .NET SDK, so most of the sample code should be easy to adapt. The Real-Time Services require C++11 so make sure to update your project settings.

License

This library is licensed under the Apache 2.0 License.

You can’t perform that action at this time.