Write your program once with C++, and create Windows, Mac, iOS and Android app.
CAT provides an abstract and consistent environment for application development. The main features include:
- Graphics Renderer
- UI Framework
- Time Service
- Network Service
- Audio Service
- Media Service - TODO (camera, video player)
- Sensor Service - TODO
- Blank skeleton - program structure and life cycle
- Basic UI - basic ui like pane and button
- Storage - persistent storage
- Timer - create and remove timers
- HTTP - rest compatible http client
- Sound - audio playback
You can build app on two environments, sadly you cannot build binaries for all platforms with a single environment. Here is the matrix:
- Windows 32-bit App
- Windows 64-bit App
- Android App
- Mac OS X App
- iOS App
- Android App
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg/
./bootstrap-vcpkg.sh
./vcpkg integrate install
https://github.com/microsoft/vcpkg/blob/master/docs/users/android.md
export ANDROID_NDK_HOME=/c/android/sdk/ndk/21.3.6528147
export VCPKG_ROOT=/c/vcpkg
Add to windows environment for gradle, right click This PC > Properties > Advanced System Settings > Environment Variables
ANDROID_NDK_HOME=c:/android/sdk/ndk/21.3.6528147
VCPKG_ROOT=c:/devtools/vcpkg
Change the above path if needed
${VCPKG_ROOT}/vcpkg install glm zlib libpng libjpeg-turbo glew --triplet x86-windows
${VCPKG_ROOT}/vcpkg install glm zlib libpng libjpeg-turbo glew --triplet x64-windows
${VCPKG_ROOT}/vcpkg install glm zlib libpng libjpeg-turbo --triplet arm-android
${VCPKG_ROOT}/vcpkg install glm zlib libpng libjpeg-turbo --triplet arm64-android
${VCPKG_ROOT}/vcpkg install glm zlib libpng libjpeg-turbo --triplet x86-android
${VCPKG_ROOT}/vcpkg install glm zlib libpng libjpeg-turbo --triplet x64-android
Open libcat/proj/libcat.vcxproj
with Visual Studio. There are four targets available: win32
, win32d
, win64
, win64d
. Libraries will be created under libcat/lib/
.
Open example/{project}/proj/example.vcxproj
with Visual Studio. There are four targets available: win32
, win32d
, win64
, win64d
. Excutables will be created under example/{project}/bin/
.
cd libcat/proj/
${ANDROID_NDK_HOME}/ndk-build.cmd -j4
Open example/{project}/proj/android
with Android Studio. APK will be created under example/{project}/bin/android/
.
- Xcode with command line tools
- Android Studio 4.0
- VCPKG
- CocoaPod
xcode-select --install
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg/
./bootstrap-vcpkg.sh
./vcpkg integrate install
https://github.com/microsoft/vcpkg/blob/master/docs/users/android.md
export VCPKG_ROOT=$HOME/devel/git/public/vcpkg
export ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk/21.3.6528147/
Change the above path if needed
${VCPKG_ROOT}/vcpkg install glm zlib libpng libjpeg-turbo --triplet arm-android
${VCPKG_ROOT}/vcpkg install glm zlib libpng libjpeg-turbo --triplet arm64-android
${VCPKG_ROOT}/vcpkg install glm zlib libpng libjpeg-turbo --triplet x86-android
${VCPKG_ROOT}/vcpkg install glm zlib libpng libjpeg-turbo --triplet x64-android
cd libcat/proj
pod install
Open libcat/proj/libcat.xcodeproj
with Xcode. Edit scheme and choose Release
under Run
section. There are two targets available: mac
, ios
. Libraries will be created under libcat/lib/
.
cd example/{project}/proj
pod install
Open example/{project}/proj/example.xcodeproj
with Xcode. Edit scheme and choose Release
under Run
section. There are two targets available: mac
, ios
. Excutables will be created under example/{project}/bin/
.
cd libcat/proj/
${ANDROID_NDK_HOME}/ndk-build -j4
Open example/{project}/proj/android
with Android Studio. APK will be created under example/{project}/bin/android/
.
Note: For Android Emulator on Mac, OpenGL3 is only available to system image with API 24 or above, note that you can still target at API 18.
Note: To build windows app on mac, you need to bootcamp or VM into Windows.
Distributed under the MIT license. See LICENSE
for more information.
- Fork it (https://github.com/shadow-paw/cat/fork)
- Create your feature branch (
git checkout origin/master -b feature-foobar
) - Commit your changes (
git commit -am 'Add some foobar'
) - Push to the branch (
git push origin feature-foobar:feature-foobar
) - Create a new Pull Request