iPhone C++ programming

3 12 2008

I am a hardcore C++ fan and I really dislike Objective C.

I decided to take a look to the iPhone SDK and see if I can make some OpenGL programming using pure C++.

I found that it’s really easy to mix both languages in the same project. You can even mix Objective C and C++ code in the same file just by adding the “.mm” extension to your files, instead of “.cpp”.

Using the OpenGL ES example bundled in the SDK I made a wrapper in C++ that receives the iPhone events I need, like input and drawing.

I modified the example so it calls to my wrapper in every drawing and input event and then, the wrapper calls to my pure C++ objects.

I can now concentrate my efforts in writing the logic and drawing methods in pure C++ and see the changes in my iPhone :mrgreen:




Ubuntu tip: backing up installed packages

1 12 2008

I have just installed a fresh copy of the new Ubuntu 8.10.

In order to mantain all the packages installed in my old system I generated a list of the currently installed packages, so I could restore them later.

dpkg --get-selections > packages

This generates a file with all the installed packages in your system. Just copy it to a safe place, usbstick or CD.

After you have installed the fresh copy of Ubuntu you can recover what was installed in your previous system with the file you generated and the following commands:

dpkg --set-selections < packages
apt-get dselect-upgrade