Skip to content

First Effort to Document the OpenGLStarter Source

After a long period documenting the base framework, I finally released the first code documentation page.

You can check it here.

The OpenGLStarter framework has a lot of code.

The code have the core library (lib/aribeiro) and the other wrappers (OpenGL,ffmpeg, freetype2, rtaudio, etc... )

I started to document the core library and I finally finished it.

I plan to document the other part of the code in my spare time.

How Did the Documentation Was Made?

I used the Doxygen to put the documentation inside the code.

There are several patterns that allow the code documentation to be made.

This is an example:

/// \brief Common string operation for use with the font renderer and generic string tests
///
/// \author Alessandro Ribeiro
///
class StringUtil {
    ...
    /// \brief Wrapper of the stdio printf to work with std::string type
    ///
    /// It is possible to use it to generate a string that will be rendered as font glyphs.
    ///
    /// \code
    /// #include <aribeiro/aribeiro.h>
    /// using namespace aRibeiro;
    ///
    /// float fps;
    ///
    /// const char* output_char_string = StringUtil::printf("fps: %.2f", fps);
    /// \endcode
    ///
    /// \author Alessandro Ribeiro
    /// \param format stdio printf like input string format descriptor
    /// \param ... va_list args
    /// \return char pointer to the generated string
    ///
    const char* printf(const char* format, ...);
};

With this comments, the Doxygen can generate the HTML that describes each class in the code.

You can check this class example here.

What Next?

As I said this is the first documentation part of the framework I did. So, I need to document all other parts.

As soon as I have more time, I will try to document a file.

File by file we get there.

xD

Conclusion

I hope this documentation could help more people to use the framework.

I first introduced the framework in a CG class I taught in the last year. I showed some OpenGL and C++ things.

Best regards,

Alessandro Ribeiro

Leave a Reply

Your email address will not be published. Required fields are marked *