From fae12fdb7c5c34ee5f3009cfb8b0e048cff61d3b Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Fri, 19 Dec 2014 21:28:03 +0300 Subject: [PATCH] Move whole descriptions into documentation headers --- SDL2pp/AudioDevice.hh | 2 ++ SDL2pp/AudioSpec.hh | 18 ++++++-------- SDL2pp/Exception.hh | 56 ++++++++++++++++++++----------------------- SDL2pp/SDL.hh | 46 ++++++++++++++++------------------- SDL2pp/Texture.hh | 8 ++----- SDL2pp/Wav.hh | 28 ++++++++++------------ SDL2pp/Window.hh | 46 ++++++++++++++++------------------- 7 files changed, 91 insertions(+), 113 deletions(-) diff --git a/SDL2pp/AudioDevice.hh b/SDL2pp/AudioDevice.hh index 3fead66..40bfcf6 100644 --- a/SDL2pp/AudioDevice.hh +++ b/SDL2pp/AudioDevice.hh @@ -35,7 +35,9 @@ class AudioSpec; //////////////////////////////////////////////////////////// /// \brief Audio device +/// /// \ingroup audio +/// /// \headerfile SDL2pp/AudioDevice.hh /// //////////////////////////////////////////////////////////// diff --git a/SDL2pp/AudioSpec.hh b/SDL2pp/AudioSpec.hh index e051661..101136e 100644 --- a/SDL2pp/AudioSpec.hh +++ b/SDL2pp/AudioSpec.hh @@ -29,8 +29,15 @@ namespace SDL2pp { //////////////////////////////////////////////////////////// /// \brief Audio format specification /// +/// \ingroup audio +/// /// \headerfile SDL2pp/Audiospec.hh /// +/// This class extends SDL_AudioSpec - a structure that describes +/// audio format. It may be used to describe format of loaded +/// SDL2pp::Wav audio fragments and to specify desired or actual +/// audio output format of SDL2pp::AudioDevice +/// //////////////////////////////////////////////////////////// class AudioSpec : public SDL_AudioSpec { public: @@ -109,14 +116,3 @@ public: } #endif - -//////////////////////////////////////////////////////////// -/// \class SDL2pp::AudioSpec -/// \ingroup audio -/// -/// This class extends SDL_AudioSpec - a structure that describes -/// audio format. It may be used to describe format of loaded -/// SDL2pp::Wav audio fragments and to specify desired or actual -/// audio output format of SDL2pp::AudioDevice -/// -//////////////////////////////////////////////////////////// diff --git a/SDL2pp/Exception.hh b/SDL2pp/Exception.hh index 3971bb8..13527f8 100644 --- a/SDL2pp/Exception.hh +++ b/SDL2pp/Exception.hh @@ -29,8 +29,34 @@ namespace SDL2pp { //////////////////////////////////////////////////////////// /// \brief %Exception object representing %SDL error /// +/// \ingroup general +/// /// \headerfile SDL2pp/Exception.hh /// +/// Internally, libSDL2pp checks return value of each SDL2 +/// function it calls which may fail. If the function fails, +/// SDL2pp::Exception is thrown, and SDL2 error which expains +/// cause of function failure is stored in the exception and +/// may be extracted later. +/// +/// what() usually contains a name of SDL2 function which failed, +/// e.g. "SDL_Init() failed" +/// +/// Usage example: +/// \code +/// { +/// try { +/// SDL2pp::SDL sdl(SDL_INIT_VIDEO); +/// } catch (SDL2pp::Exception& e) { +/// std::cerr << "Fatal error:" +/// << e.what() // "SDL_Init failed" +/// << ", SDL error: " +/// << e.GetSDLError() // "x11 not available" +/// << std::endl; +/// } +/// } +/// \endcode +/// //////////////////////////////////////////////////////////// class Exception : public std::exception { private: @@ -75,33 +101,3 @@ public: } #endif - -//////////////////////////////////////////////////////////// -/// \class SDL2pp::Exception -/// \ingroup general -/// -/// Internally, libSDL2pp checks return value of each SDL2 -/// function it calls which may fail. If the function fails, -/// SDL2pp::Exception is thrown, and SDL2 error which expains -/// cause of function failure is stored in the exception and -/// may be extracted later. -/// -/// what() usually contains a name of SDL2 function which failed, -/// e.g. "SDL_Init() failed" -/// -/// Usage example: -/// \code -/// { -/// try { -/// SDL2pp::SDL sdl(SDL_INIT_VIDEO); -/// } catch (SDL2pp::Exception& e) { -/// std::cerr << "Fatal error:" -/// << e.what() // "SDL_Init failed" -/// << ", SDL error: " -/// << e.GetSDLError() // "x11 not available" -/// << std::endl; -/// } -/// } -/// \endcode -/// -//////////////////////////////////////////////////////////// diff --git a/SDL2pp/SDL.hh b/SDL2pp/SDL.hh index aa15b56..a337d8d 100644 --- a/SDL2pp/SDL.hh +++ b/SDL2pp/SDL.hh @@ -29,8 +29,29 @@ namespace SDL2pp { //////////////////////////////////////////////////////////// /// \brief Object taking care of %SDL library (de-)initialization /// +/// \ingroup general +/// /// \headerfile SDL2pp/SDL.hh /// +/// Before using any SDL2 functions, the library must be initialized. +/// Likewise, it should be deinitialized before application exits. +/// SDL2pp::SDL object takes care of this in a RAII way +/// by initializing the library in constructor and deinitializing +/// in destructor, with an ability to init/quit specific subsystems +/// in between +/// +/// Usage example: +/// \code +/// int main() { +/// SDL2pp::SDL sdl(SDL_INIT_VIDEO); +/// +/// // ...use SDL functions... +/// +/// // SDL library is automatically deinitialized before exit +/// return 0; +/// } +/// \endcode +/// //////////////////////////////////////////////////////////// class SDL { public: @@ -99,28 +120,3 @@ public: } #endif - -//////////////////////////////////////////////////////////// -/// \class SDL2pp::SDL -/// \ingroup general -/// -/// Before using any SDL2 functions, the library must be initialized. -/// Likewise, it should be deinitialized before application exits. -/// SDL2pp::SDL object takes care of this in a RAII way -/// by initializing the library in constructor and deinitializing -/// in destructor, with an ability to init/quit specific subsystems -/// in between -/// -/// Usage example: -/// \code -/// int main() { -/// SDL2pp::SDL sdl(SDL_INIT_VIDEO); -/// -/// // ...use SDL functions... -/// -/// // SDL library is automatically deinitialized before exit -/// return 0; -/// } -/// \endcode -/// -//////////////////////////////////////////////////////////// diff --git a/SDL2pp/Texture.hh b/SDL2pp/Texture.hh index f71a3ba..271b1e1 100644 --- a/SDL2pp/Texture.hh +++ b/SDL2pp/Texture.hh @@ -41,6 +41,8 @@ class RWops; /// \brief Image stored in the graphics card memory that /// can be used for fast drawing /// +/// \ingroup rendering +/// /// \headerfile SDL2pp/Texture.hh /// //////////////////////////////////////////////////////////// @@ -234,9 +236,3 @@ public: } #endif - -//////////////////////////////////////////////////////////// -/// \class SDL2pp::Texture -/// \ingroup rendering -/// -//////////////////////////////////////////////////////////// diff --git a/SDL2pp/Wav.hh b/SDL2pp/Wav.hh index e604893..733bdee 100644 --- a/SDL2pp/Wav.hh +++ b/SDL2pp/Wav.hh @@ -33,8 +33,20 @@ class RWops; //////////////////////////////////////////////////////////// /// \brief Chunk of audio data read from a .WAV file /// +/// \ingroup audio +/// /// \headerfile SDL2pp/Wav.hh /// +/// SDL2pp::Wav is a wrapper around basic SDL2 audio fragment +/// handling functionality, basically SDL_LoadWAV and related +/// functions. +/// +/// The class holds raw audio data which is loaded from a disk +/// file or from an arbitrary source with SDL2pp::RWops and +/// may be used in audio playback. +/// +/// See audio_wav demo for an example. +/// //////////////////////////////////////////////////////////// class Wav { private: @@ -124,19 +136,3 @@ public: } #endif - -//////////////////////////////////////////////////////////// -/// \class SDL2pp::Wav -/// \ingroup audio -/// -/// SDL2pp::Wav is a wrapper around basic SDL2 audio fragment -/// handling functionality, basically SDL_LoadWAV and related -/// functions. -/// -/// The class holds raw audio data which is loaded from a disk -/// file or from an arbitrary source with SDL2pp::RWops and -/// may be used in audio playback. -/// -/// See audio_wav demo for an example. -/// -//////////////////////////////////////////////////////////// diff --git a/SDL2pp/Window.hh b/SDL2pp/Window.hh index ba97d3e..474ffa6 100644 --- a/SDL2pp/Window.hh +++ b/SDL2pp/Window.hh @@ -35,8 +35,29 @@ namespace SDL2pp { //////////////////////////////////////////////////////////// /// \brief GUI window object /// +/// \ingroup windows +/// /// \headerfile SDL2pp/Window.hh /// +/// SDL2pp::Window is a wrapper around SDL_Window structure +/// and related functions which take care of GUI window +/// management. +/// +/// Usage example: +/// \code +/// { +/// SDL2pp::SDL sdl(SDL_INIT_VIDEO); +/// SDL2pp::Window window("Test Window", +/// SDL_WINDOWPOS_UNDEFINED, +/// SDL_WINDOWPOS_UNDEFINED, +/// 640, +/// 480, +/// SDL_WINDOW_OPENGL); +/// +/// SDL_Delay(3000); // show window for 3 seconds +/// } +/// \endcode +/// //////////////////////////////////////////////////////////// class Window { private: @@ -129,28 +150,3 @@ public: } #endif - -//////////////////////////////////////////////////////////// -/// \class SDL2pp::Window -/// \ingroup windows -/// -/// SDL2pp::Window is a wrapper around SDL_Window structure -/// and related functions which take care of GUI window -/// management. -/// -/// Usage example: -/// \code -/// { -/// SDL2pp::SDL sdl(SDL_INIT_VIDEO); -/// SDL2pp::Window window("Test Window", -/// SDL_WINDOWPOS_UNDEFINED, -/// SDL_WINDOWPOS_UNDEFINED, -/// 640, -/// 480, -/// SDL_WINDOW_OPENGL); -/// -/// SDL_Delay(3000); // show window for 3 seconds -/// } -/// \endcode -/// -////////////////////////////////////////////////////////////