Next Previous Contents

5. Misc Items

5.1 Isn't there already an SDL & KDevelop mini-HOWTO?

There is one by Phoenix Kokido available at http://members.nbci.com/_XMCM/kokido/SDLinKdevelop. However, if you read this document you discover that it has the exact same problems as detailed in section 1.2 above. Kokido's mini-HOWTO will produce non-standard SDL applications that aren't portable at all.

To be fair, Kokido's mini-HOWTO was written over two years ago. This was also when I first started using SDL and KDevelop together, and I thought the approach taken in his mini-HOWTO was fine as well. Now that I have had two years of experience managing a Free-Software project which has been ported to several OSes besides Linux, I know that more steps should be taken in order to make SDL & KDevelop work correctly together.

5.2 Using SDL Docs in KDevelop

One of the nice things about KDevelop is the fact that it has a rather sophisticated online documentation browser. As a matter of fact, the latest version of KDevelop at the time of this writing even has many searching and indexing features for its installed documentation.

The SDL documentation available on the web can be easily incorporated into KDevelop. Simply download the documentation, and install it somewhere (I personally like to install it with the rest of my documentation at /usr/doc or /usr/share/doc, but you can really install it anywhere you desire, including your home directory). After you have installed the documentation, switch to the "Books" tab in the "Tree View" on the left of your KDevelop window. Right click on the "Others" folder and select "Add Entry". An "Add Entry" dialog will pop up.

Inside this dialog should be two entry fields. The first will be "Name". Here is where you enter the name of the documentation (for example, if you were installing the SDL FAQs, you could enter "SDL FAQs" here).

The second field will be "File". You can enter into this field the path and file to the first page in the documentation, or you can click on the "Open" button next to the field and browse to the first page in the documentation.

All you need to do is inform KDevelop where the first page of the document is, since the remaining pages should be linked from the first page.

Phoenix Kokido's SDL 1.0 Docs

Kokido did produce some SDL 1.0 documentation which he formatted nicely for KDevelop. You can find this documentation from his site here: http://members.nbci.com/_XMCM/kokido/SDLdocs.tar.gz

Unfortunately, this documentation is now dated, and there has recently been a new SDL documentation project which actually produces HTML documentation ready for inclusion into KDevelop.

SDL Documentation Project

The SDL Documentation Project is one of the best things to happen to SDL ever. It consists of an Introduction to SDL (which actually predates the SDLDoc Project ;-) written in English, French and Italian, the SDL FAQ pages, the SDL Unix manpages, and the SDL Documentation Project itself.

You can find the available SDL documentation at http://www.libsdl.org/docs.html

Any of the documentation available here which is in HTML format can be included with the KDevelop documentation browser.

SDL Header Files

One of my favorite items in my KDevelop documentation browser is actually not a real document at all, but the SDL header files converted into HTML documents.

To convert C or C++ code into colored, formatted HTML you need a converter. My personal favorite is Code2HTML from http://www.palfrader.org/code2html/, but a search on Freshmeat shows that you actually have a large number of conversion utilities to choose from.

Simply run the converter on any SDL header files you wish, and insert them into your KDevelop documentation browser.

5.3 A Better SDL & KDevelop Setup

KDevelop has an Application Wizard which is template based (this is the same Wizard that causes the whole KDevelop and SDL conflict). Technically speaking you can write new templates for this wizard which will produce a build process better tuned for SDL.

The problem is that the latest stable version of KDevelop at the time of this writing is version 1.4. The 1.X series of KDevelop has this template information hardcoded into KDevelop's source. Forgetting any gripes, complaints and chastizement to the KDevelop team for doing such a thing, this policy essentially means that without hacking up your existing template files, you will not be able to add new templates to the mix.

However, all is not lost. KDevelop 2.0 (which is presently under very active development) will apparently have the ability to import new templates (it supposedly will have a "plugin" feature as well, which may assist in further solving this problem).

So technically you will be able to write your own templates for the KDevelop Application Wizard. Thus it is very conceivable that someone, someday will write an SDL application template for this wizard which will make this document obsolete.

I do not know how these templates work, nor do I fully understand the auto{make|conf} process, so I will likely not be the person writing it. However, I look forward to the day that this template will be written ;-)

5.4 A Kludge Solution for KDevelop 1.X

I have template files located at:

which can be used to replace the C and C++ templates in the latest version of KDevelop. These template files give you a SDL + C or and SDL + C++ development environment inside KDevelop without having to apply the techniques mentionned in this document.

However, solving your problem this way will prevent you from creating basic C or C++ projects, so there is a serious downside.

If you do choose to use these templates, it is advisable to keep the original C and C++ templates in case you ever need them again!


Next Previous Contents