Mad Marbles

Started by
1 comment, last by undead 11 years, 7 months ago
The image is a screenshot of my android live wallpaper: Mad Marbles. It renders multicolor marbles on your device home screen. Marbles move according to your device orientation and they can collide with each other. They are also interactive: you can select a marble with your finger and move it (or throw it) around the screen.

Physics is implemented using Box2D in C/C++ compiled for ARM and JNI. Marbles are rendered with an OpenGL ES 2.0 fragment shader.

I decided to develop for android because when my old phone stopped working I found a good deal for an android phone.
At the beginning I thought learning android programming would be nice so I developed an app for internal use checking a web service status.
After that I wanted to give a try to something I enjoy more: graphic programming.

Well.. Mad Marbles is the result. smile.png

Some of the lessons I learned during this project are:
- how to write (and use) native code in android for CPU-intensive tasks
- how to implement a live wallpaper with OpenGL ES using custom preferences, reading orientation, etc.
- how to effectively use intents, create a shortcut, select (and scale) images from device, write code adapting to different resolutions
- how OpenGL ES works (I've been a Direct3D guy for years)

I also learned how hard it is to get visibility on google play!!! sleep.png

If you have an android device you can give a try to the free version:

https://play.google.....madmarbleslite

Click here to view the iotd
Advertisement
This is really impressive! And it works perfectly on my SG S3 :)
How did you find OpenGL ES?

Saving the world, one semi-colon at a time.

The app uses OpenGL ES 2.0 and being forced to use shaders conceptually it isn't so hard because I'm used to shaders since D3D9.

What is a little weird for a D3D dev is texture handling which is high level compared to pointers and double pointers we are used to work with when using D3D. Also setting states is a little different.

Also fragment and vertex program parameter binding is a little weird. I had the same inputs, same names and same position for vertex and fragment shaders params so I assumed they were shared or at least ordered the same way. When testing on a SG S2 it worked perfectly, but on a SG TAB 2 it didn't render anything unless I bind both parameters.

I'm glad you like it, thank you! smile.png

This topic is closed to new replies.

Advertisement