Skip to content

libgdx-cpp is a port of the awesome java libgdx 2d and 3d engine for C++ so we can run it on desktop, android and ios (hopefully)

License

Notifications You must be signed in to change notification settings

henviso/libgdx-cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libgdx-cpp: libgdx C++ port

Build guide

Linux

These are the requirements to compile libgdx-cpp over linux(ubuntu):

  • cmake
  • libsdl
  • libgles1-mesa-dev
  • libgles2-mesa-dev
  • libopenal-dev

Step-by-step (Ohhh baby)

  1. create a build dir somewhere on your home partition
  2. cmake PATH-TO-CHECKED-OUT-LIBGDXCPP
  3. ccmake .
  4. Edit your configuration as needed
  5. make

Libraries will be generated under the lib folder, binaries under the bin folder

Running the tests

  1. Create/Symlink the data folder to the assets directory
  2. Execute the desired test

Android

LibgdxCpp uses the cmake toolset from android-cmake. Sadly, currently cmake doesn't support multiple toolsets under the same build directory, so you'll have to create another build folder.

Requirements:

  • Android r5b or newer (platform9)
  • Eclipse + DDMS (to actually build the apk's)

Step-by-step guide

  1. create a build dir somewhere on your home partition
  2. cmake -DCMAKE_TOOLCHAIN_FILE=PATH-TO-CLONED-LIBGDXCPP/cmake/android.toolchain.cmake PATH-TO-CLONED-LIBGDXCPP
  3. ccmake .
  4. Edit your configuration as needed
  5. make

Libraries will be generated under the lib folder, binaries under the bin folder

Running the tests

  1. Import the Eclipse project under PATH-TO-CLONED-LIBGDXCPP/src/backends/gdx-cpp-backend-android/android-support
  2. Import the Eclipse project under PATH-TO-CLONED-LIBGDXCPP/src/test/backend/android (I'll call it test-project from now)
  3. Under Eclipse, edit the test project to point to the android support library (witch you imported on step 1)
  4. Under the test-project/libs you'll have to symlink the required shared libraries to make the test run.If you compiled the backend to armeabi it will be test-project/libs/armeabi. If armeabi-v7a it will be under test-project/libs/armeabi-v7a. Make sure you symlinked all requirements (like libgdx-cpp, libgdx-box2d, libBox2D, and so on)
  5. Under Eclipse, change the initializeWithSharedLib method to the desired library without the lib prefix on it.
  6. Run the project and pray for the Android gods

Differences from libgdx

The texture class constructors that received an managed texture data had to be changed to static constructors. This is because C++ contruction blocks us to use shared_pointers, so we had to make it two-phase-like. So instead of calling the constructor, you'll have to call, for example:

Texture::fromFile()

whith the same parameters that you would expect on the constructor.

What's working

  • The linux backend has file and input working
  • The android backend has input working

What has to be done

  • Backend polishing. Seriously, it's working, but there is a lot of stuff that is ugly and were fast-made.
  • iOs support
  • etc

About

libgdx-cpp is a port of the awesome java libgdx 2d and 3d engine for C++ so we can run it on desktop, android and ios (hopefully)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 87.9%
  • C 11.9%
  • Java 0.2%