Coder Social home page Coder Social logo

dimon4eg / appwarpcocos2dx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shephertz/appwarpcocos2dx

0.0 2.0 0.0 10.81 MB

Cocos2DX SDK for AppWarp

CMake 0.64% C++ 83.86% Makefile 0.29% Java 0.29% Objective-C 0.42% Objective-C++ 1.30% C 13.20%
appwarp cocos2d-x realtime

appwarpcocos2dx's Introduction

##Cocos2DX SDK for AppWarp

Visit AppWarp Cocos2DX home page to learn about AppWarp features and documentation.

IMPORTANT The instructions below assume you have already setup Cocos2DX environment for iOS and Android development. To help set up your development for Cocos2DX, you can read this Cocos2DX getting started guide.

The steps below describe the integration points of AppWarpX in your Cococs2DX application.

##Instructions for iOS

  • Download the contents of this repo

  • Extract the contents and add (drag n drop) the AppWarpX folder to your xcode project.

  • Your XCode structure should look something like this

AppWarp Cocos2dx iOS

  • Now add path for curl as follows:

    -Open Xcode project

    -Click on project name in the left pane

    -Select your project under PROJECT heading and search for Header Search Path

    -Double click on the value of Header Search Path

    -Click on "+" button on the bottom left cornor of the popup appeared

    -Add this: "$(SRCROOT)/../cocos2d/external/curl/include/ios"

The Header Search path should look like this

AppWarp Cocos2dx iOS

You also need to add library search path as follows:

-Select your project under PROJECT heading and search for Library Search Path 

-Double click on the value of Library Search Path

-Click on "+" button on the bottom left cornor of the popup appeared 

-Add this: "$(SRCROOT)/../cocos2d/external/curl/prebuilt/ios"

The Library Search path should look like this

AppWarp Cocos2dx iOS

Now select your project under Targets section and add $(inherited) to Library Search Path under build settings:

The Library Search path should look like this

AppWarp Cocos2dx iOS

After that, add "-lcurl" to Other Linker Flags under build settings:

The Other Linker Flags should look like this

AppWarp Cocos2dx iOS

  • Build

##Instructions for Android

  • Download the contents of this repo

  • Extract and add the AppWarpX folder next to your Classes folder. The directory structure should look like this

AppWarp Cocos2dx iOS

  • download cocos2d-x 3.17 and install it

  • copy cocos2d folder to NinjaFightMultiplayerDemo/cocos2d

  • Edit proj.android\jni\Android.mk file

  • Add $(call import-module,curl/prebuilt/android) to Android.mk file if you are using cocos V3.X or above for enabling cURL support.

Add AppWarp source c and cpp files so that they can also be built. After adding the AppWarp source files, your android.mk file should be as follows:

LOCAL_SRC_FILES := hellocpp/main.cpp \
                   ../../Classes/AppDelegate.cpp \
                   ../../Classes/HelloWorldScene.cpp \
                   ../../AppWarpX/appwarp.cpp \
                   ../../AppWarpX/appwarp_extended.cpp \
                   ../../AppWarpX/base64.cpp \
                   ../../AppWarpX/cJSON.c \
                   ../../AppWarpX/HMAC_SHA1.cpp \
                   ../../AppWarpX/requests.cpp \
                   ../../AppWarpX/SHA1.cpp \
                   ../../AppWarpX/socket.cpp \
                   ../../AppWarpX/udpsocket.cpp \
                   ../../AppWarpX/urlencode.cpp \
                   ../../AppWarpX/utilities.cpp

Add AppWarp source file folder so that it can be detected by Compiler. For Example :

	LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
			    		$(LOCAL_PATH)/../../AppWarpX
  • Build the native code

  • Add the following to your manifest file to give internet permission if not given already

<uses-permission android:name="android.permission.INTERNET" />
  • Run your Android application

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.