gdx-audio

I just finished off gdx-audio, our newest extension. Features:

  • Decoders for mp3, ogg Vorbis and wav, using Mpg123, Xiph Tremor
  • KissFFT and Java FFT by Damien Di Fede for comparison
  • SoundTouch for pitch shifting, time stretching and playback rate modification

To use the extension add the gdx-audio.jar and gdx-audio-natives.jar to your desktop project. For your android project add the gdx-audio.jar and copy the libgdx-audio.so files to your libs/armeabi and libs/armeabi-v7a folders.

For usage examples see:

  • Mpg123Test, shows how to decode an mp3 with the Mpg123Decoder class
  • VorbisTest, shows how to decode an ogg with the VorbisDecoder class
  • WavTest, shows how to decode an wav with the WavDecoder class
  • SoundTouchTest, shows how to apply pitch shifting to a PCM stream

Caveat: the vorbis and mp3 decoder can only decode files stored on the external storage. I might be able to work around that limitation in the future. For most practical purposes it shouldn’t be to limiting.

gdx-jnigen: a stupid idea that might just work

Since i’m to lazy to type, i made a demo video. All the native code in libgdx uses this now. I explain the reasons in the video. Use at your own risk. Also, sorry for the crappy audio, my headset died.

edit: as Riven kindly pointed out, there’s a bug in the add method. Look at the offset, now back to me, now back at numElements, now back to me. Sadly, i never learned how to iterate over arrays given offsets :D

Beginning Android 4 Games Development

preface: this is soley my view of things, Robert has nothing to do with this post.

http://www.amazon.com/Beginning-Android-Development-Apress-ebook/product-reviews/B006LPJXZ6/ref=sr_1_3_cm_cr_acr_txt?ie=UTF8&showViewpoints=1

So, i was asked by my publisher to write a second edition of “Beginning Android Games”, updated to ICS. At the time i was asked, ICS was not out yet, there were also just rumours and nobody really knew when it would drop. On top of that, i didn’t have the intent of writting a second edition, as i just finished the first one and was loaded with a ton of other work that had to take priority.

I declined the offer. I was informed that they would hire another person (any other person really) to do the job and that i would lose my authorship (that is, my name wouldn’t be on the book even if it was 100% my writting). The contract i signed for the first edition gives the publisher the full right to do that, for better or worse. For obvious reasons i didn’t want this to happen. So i asked Robert Green from Battery Powered Games if he wanted to take over. I could take on the part of a technical reviewer and he’d write the additions.

The end result is an updated version of the original book, with bug and typo fixes and a few additions concerning Honeycomb and ICS. I did not invest any time apart from going over Robert’s changes.

If anything, it should have been called “Beginning Android Games, Second Edition”, putting 4 in the title is suggesting it’s full of ICS related material.

I can not add more at this point due to legal reasons. Suffice it to say that i’m not happy with it either and as with any purchase, you have to evaluate whether it’s worth it for you or not.

Here’s the second edition’s TOC on Amazon for your convenience.

Update to Lwjgl 2.8.2

I just updated libgdx to use Lwjgl 2.8.2 on the desktop. Please test it on your favorite platform and let me know of any problems. I tested it on win32/64 and lin32/64 (Ubuntu in VirtualBox with HW acceleration enabled) without any kind of problems.

The new version also allows us to have the Lwjgl window be resizable. To enable this feature just set the respective field in LwjglApplicationConfiguration to true:

LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.resizable = true;
new LwjglApplication(new MyListener(), config);

Nightlies Moved!

I moved everything over to our own servers now. I pay 40€/month for all of this. Yes, i complain :D

In any case, you can find the latest nightlies here: http://libgdx.badlogicgames.com/nightlies

New Build System

I reworked the build system over the last couple of days. It’s now composed of the following:

  • build.xml: the master Ant build script. Responsible for building the core, all backends, extensions and docs
  • build-template.xml: a template Ant script used to build all projects. Invoked by the master build script with appropriate parameters for a project’s classpath, jars that should go into the output jar and so on.

That’s about it. As a result, the release/nightly builds now have the following structure:


docs/
extensions/
armeabi/
armeabi-v7a/
sources/
gdx-$extensionname-sources.jar
gdx-$extensionname.jar
gdx-$extensionname-natives.jar
armeabi/
armeabi-v7a/
sources/
gdx-$projectname-sources.jar
gdx-$projectname.jar
gdx-$projectname-natives.jar

The core and backend jars are in the root folder of the distribution. The armeabi/ and armeabi-v7a/ folder contain the natives for Android, the gdx-$projectname-natives.jar contain the natives for the respective desktop project.

The extensions folder has the same setup for extensions (jars + desktop natives jars + arm binaries).

In other news: i removed the audio analysis and decoder classes from the core, they are now in gdx-audio. I’ll have those finished by the end of the day, including the mpg123 decoder. Stb TrueType has been moved to its own extension as well (gdx-stb-truetype).

You can now easily build your own distribution by invoking:


ant -f build-new.xml

This will create a dist/ directory containing all the jars and natives for both core and extension projects as outlined above. Only requirement: ant needs to be on your $PATH, JAVA_HOME needs to point to your JDK installation.

You can also build individual projects via:


ant -f build-new.xml gdx-$projectname

More things to come :D

Oh god, it’s 6am and…

comments should work again!

i hate writting JNI bindings, e.g. for bullet. So i spent the last couple of hours on this:

I’ll explain it tomorrow. Not sure what to call it, abomination is probably the most fitting.

Beginning Android Games – Spanish Edition

David Erosa informed me that there is a spanish version of my book “Beginning Android Games”. I like it’s cover more than the other one :D Thanks for informing me David, my publisher can’t be boughter to write me a mail about such things.

Deprecation and TODO

Hi there,

i’m back, kinda sorta. Here’s a list of things i plan on doing over the next 3 months.

  • New Features
    • 3D Support
      • FBX/Collada will be imported to Unity, exported to JSON/binary, readable by the new model loader(s).
      • Skeletal Animation support, CPU and GPU skinning.
      • Model batching/instancing.
      • Materials
      • Particles (merging with 2D particles in terms of editor)
      • (Spatial) scene graph & simple partitioning
      • We might go GLES 2.0 exclusive for this as it makes my life easier :)
    • Integrate more/new Android APIs (not sure which yet).
    • GWT backend
  • Documentation
    • Update Wiki, add new articles, steal stuff from libgdx user Wiki :D
    • Documented example projects, supplement test suite
  • Bug Fixes
    • Fix the on-resume bug on Android
    • Fix KissFFT, output should match FFT class
    • libmpg123 licensing issue, separate .so file
    • General issue tracker sweep
  • Refactoring/Clean-Up
    • Current 3D APIs, TextureRef, TextureDict etc.
    • Rework/Replace TileD support
    • Remove DecalBatch? It’s slow.

Quite a lot to do as you can tell. I’ll spit out details about individual bullet points in the coming weeks.

In other news, we deprecated the following projects:

We feel that the scene2d UI framework is sufficiently mature to be used as an alternative for TWL. We also don’t have a maintainer for the TWL extension anymore. I guess getting rid of it is the best solution to not have to much dead code in the trunk.

ciao,

Mario

BitmapFont, Delta Y and other fixes

Hi there,

fixed a couple of issues on the tracker today (or set them to invalid/won’t fix where appropriate). The biggest changes that might affect your application:

  • BitmapFont constructors taking a TextureRegion: if you call BitmapFont#dispose() on such a BitmapFont, the Texture the region refers to won’t be disposed. You have to explicitely kill that Texture yourself. This allows sharing a texture among BitmapFonts if you are not using AssetManager. With AssetManager, everything is done for you automatically, including reference counting.
  • The Lwjgl backend reported the delta y for the mouse cursor incorrectly. It’s sign is now inverted, in accordance with the behaviour of the Jogl and Android backends.

I fixed a couple of other issues and merged the patches people submitted. Thanks for that, very much appreciated! I hope to have more time for libgdx in the near future. Stay tuned for new stuff!