From 78e985719e0b3f4f7444105d6f46768dc6c49588 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Fri, 26 Dec 2014 22:36:29 +0300 Subject: [PATCH] Add references to SDL docs and exception info --- SDL2pp/AudioDevice.hh | 18 ++++++++----- SDL2pp/AudioSpec.hh | 2 ++ SDL2pp/Point.hh | 2 ++ SDL2pp/Rect.hh | 2 ++ SDL2pp/Renderer.hh | 60 +++++++++++++++++++++++++++++++++++++++++++ SDL2pp/SDL.hh | 4 +++ SDL2pp/Texture.hh | 38 +++++++++++++++++++++++++++ SDL2pp/Wav.hh | 8 ++++++ 8 files changed, 128 insertions(+), 6 deletions(-) diff --git a/SDL2pp/AudioDevice.hh b/SDL2pp/AudioDevice.hh index d235ec3..d1530d4 100644 --- a/SDL2pp/AudioDevice.hh +++ b/SDL2pp/AudioDevice.hh @@ -45,11 +45,10 @@ class AudioSpec; class AudioDevice { public: //////////////////////////////////////////////////////////// - /// \brief SDL2pp::AudioDevice lock - /// \headerfile SDL2pp/AudioDevice.hh /// \ingroup audio + /// \headerfile SDL2pp/AudioDevice.hh + /// \brief SDL2pp::AudioDevice lock /// - /// \details /// Audio devices may be locked, which means that audio /// callback will not be called in a locked state, allowing /// to change data it accesses in a thread-safe way. @@ -88,13 +87,13 @@ public: /// /// \param device Pointer to audio device to lock /// - /// \see http://wiki.libsdl.org/SDL_LockAudioDevice - /// /// This operation locks a device, which remains locked /// until LockHandle is destroyed /// /// Recursive locking is allowed /// + /// \see http://wiki.libsdl.org/SDL_LockAudioDevice + /// //////////////////////////////////////////////////////////// LockHandle(AudioDevice* device); @@ -115,6 +114,8 @@ public: /// \details /// Releases the lock /// + /// \see http://wiki.libsdl.org/SDL_UnlockAudioDevice + /// //////////////////////////////////////////////////////////// ~LockHandle(); @@ -181,6 +182,8 @@ public: /// \param spec Audio output format /// \param callback Callback which will feed audio to the device /// + /// \throws SDL2pp::Exception + /// /// \see http://wiki.libsdl.org/SDL_OpenAudioDevice /// //////////////////////////////////////////////////////////// @@ -197,6 +200,8 @@ public: /// \param spec Desired audio output format (may be changed) /// \param callback Callback which will feed audio to the device /// + /// \throws SDL2pp::Exception + /// /// \see http://wiki.libsdl.org/SDL_OpenAudioDevice /// //////////////////////////////////////////////////////////// @@ -271,7 +276,6 @@ public: /// /// \returns Lock handle used to control lock lifetime /// - /// \details /// The device remains locked for the lifetime of returned LockHandle /// /// Recursive locking is allowed @@ -288,6 +292,8 @@ public: /// \param data Data to queue for later playback /// \param len Data length in bytes (not samples!) /// + /// \throws SDL2pp::Exception + /// /// \see http://wiki.libsdl.org/SDL_QueueAudio /// //////////////////////////////////////////////////////////// diff --git a/SDL2pp/AudioSpec.hh b/SDL2pp/AudioSpec.hh index cae9bec..293d0de 100644 --- a/SDL2pp/AudioSpec.hh +++ b/SDL2pp/AudioSpec.hh @@ -38,6 +38,8 @@ namespace SDL2pp { /// SDL2pp::Wav audio fragments and to specify desired or actual /// audio output format of SDL2pp::AudioDevice /// +/// \see http://wiki.libsdl.org/SDL_AudioSpec +/// //////////////////////////////////////////////////////////// class AudioSpec : public SDL_AudioSpec { public: diff --git a/SDL2pp/Point.hh b/SDL2pp/Point.hh index 0923166..d98e65b 100644 --- a/SDL2pp/Point.hh +++ b/SDL2pp/Point.hh @@ -41,6 +41,8 @@ namespace SDL2pp { /// reference. It also supports direct access to x and y /// members. /// +/// \see http://wiki.libsdl.org/SDL_Point +/// //////////////////////////////////////////////////////////// class Point : public SDL_Point { public: diff --git a/SDL2pp/Rect.hh b/SDL2pp/Rect.hh index 36647c0..7b7049d 100644 --- a/SDL2pp/Rect.hh +++ b/SDL2pp/Rect.hh @@ -45,6 +45,8 @@ class Point; /// reference. It also supports direct access to x, y, w /// and h members. /// +/// \see http://wiki.libsdl.org/SDL_Rect +/// //////////////////////////////////////////////////////////// class Rect : public SDL_Rect { public: diff --git a/SDL2pp/Renderer.hh b/SDL2pp/Renderer.hh index 5c50685..80bfd9a 100644 --- a/SDL2pp/Renderer.hh +++ b/SDL2pp/Renderer.hh @@ -60,12 +60,18 @@ public: /// the requested flags /// \param flags 0 or more SDL_RendererFlags OR'ed together /// + /// \throws SDL2pp::Exceptions + /// + /// \see http://wiki.libsdl.org/SDL_CreateRenderer + /// //////////////////////////////////////////////////////////// Renderer(Window& window, int index, Uint32 flags); //////////////////////////////////////////////////////////// /// \brief Destructor /// + /// \see http://wiki.libsdl.org/SDL_DestroyRenderer + /// //////////////////////////////////////////////////////////// virtual ~Renderer(); @@ -122,6 +128,8 @@ public: //////////////////////////////////////////////////////////// /// \brief Clear the current rendering target with the drawing color /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderClear /// //////////////////////////////////////////////////////////// @@ -133,6 +141,8 @@ public: /// \param info SDL_RendererInfo structure to be filled with /// information about the current renderer /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_GetRendererInfo /// //////////////////////////////////////////////////////////// @@ -147,6 +157,8 @@ public: /// \param dstrect Destination rectangle, NullOpt for the entire /// rendering target /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderCopy /// //////////////////////////////////////////////////////////// @@ -168,6 +180,8 @@ public: /// \param flip SDL_RendererFlip value stating which flipping /// actions should be performed on the texture /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RendererFlip /// \see http://wiki.libsdl.org/SDL_RenderCopyEx /// @@ -182,6 +196,8 @@ public: /// \param b Blue value used to draw on the rendering target /// \param a Alpha value used to draw on the rendering target /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_SetRenderDrawColor /// //////////////////////////////////////////////////////////// @@ -190,6 +206,8 @@ public: //////////////////////////////////////////////////////////// /// \brief Set current render target to default /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_SetRenderTarget /// //////////////////////////////////////////////////////////// @@ -201,6 +219,8 @@ public: /// \param texture Target texture, SDL2pp::Texture created with /// SDL_TEXTUREACCESS_TARGET /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_SetRenderTarget /// //////////////////////////////////////////////////////////// @@ -211,6 +231,8 @@ public: /// /// \param blendMode SDL_BlendMode to use for blending /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_BlendMode /// \see http://wiki.libsdl.org/SDL_SetRenderDrawBlendMode /// @@ -223,6 +245,8 @@ public: /// \param x X coordinate of the point /// \param y Y coordinate of the point /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderDrawPoint /// //////////////////////////////////////////////////////////// @@ -233,6 +257,8 @@ public: /// /// \param p Coordinates of the point /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderDrawPoint /// //////////////////////////////////////////////////////////// @@ -244,6 +270,8 @@ public: /// \param points Array of coordinates of points to draw /// \param count Number of points to draw /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderDrawPoints /// //////////////////////////////////////////////////////////// @@ -257,6 +285,8 @@ public: /// \param x2 X coordinate of the end point /// \param y2 Y coordinate of the end point /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderDrawLine /// //////////////////////////////////////////////////////////// @@ -268,6 +298,8 @@ public: /// \param p1 Coordinates of the start point /// \param p2 Coordinates of the end point /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderDrawLine /// //////////////////////////////////////////////////////////// @@ -279,6 +311,8 @@ public: /// \param points Array of coordinates of points along the polyline /// \param count Number of points to draw count-1 polyline segments /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderDrawLines /// //////////////////////////////////////////////////////////// @@ -292,6 +326,8 @@ public: /// \param x2 X coordinate of the end corner /// \param y2 Y coordinate of the end corner /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderDrawRect /// //////////////////////////////////////////////////////////// @@ -303,6 +339,8 @@ public: /// \param p1 Coordinates of the start corner /// \param p2 Coordinates of the end corner /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderDrawRect /// //////////////////////////////////////////////////////////// @@ -313,6 +351,8 @@ public: /// /// \param r Rectange to draw /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderDrawRect /// //////////////////////////////////////////////////////////// @@ -324,6 +364,8 @@ public: /// \param rects Array of rectangles to draw /// \param count Number of rectangles /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderDrawRects /// //////////////////////////////////////////////////////////// @@ -337,6 +379,8 @@ public: /// \param x2 X coordinate of the end corner /// \param y2 Y coordinate of the end corner /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderFillRect /// //////////////////////////////////////////////////////////// @@ -348,6 +392,8 @@ public: /// \param p1 Coordinates of the start corner /// \param p2 Coordinates of the end corner /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderFillRect /// //////////////////////////////////////////////////////////// @@ -358,6 +404,8 @@ public: /// /// \param r Rectange to draw /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderFillRect /// //////////////////////////////////////////////////////////// @@ -369,6 +417,8 @@ public: /// \param rects Array of rectangles to draw /// \param count Number of rectangles /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderFillRects /// //////////////////////////////////////////////////////////// @@ -386,6 +436,8 @@ public: /// \param pitch Number of bytes in a row of pixel data, including /// padding between lines /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderReadPixels /// //////////////////////////////////////////////////////////// @@ -397,6 +449,8 @@ public: /// \param rect New clipping rectangle or NullOpt to dusable /// clipping /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderSetClipRect /// //////////////////////////////////////////////////////////// @@ -408,6 +462,8 @@ public: /// \param w Width of the logical resolution /// \param h Heigth of the logical resolution /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderSetLogicalSize /// //////////////////////////////////////////////////////////// @@ -419,6 +475,8 @@ public: /// \param scaleX Horizontal scaling factor /// \param scaleY Vertical scaling factor /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderSetScale /// //////////////////////////////////////////////////////////// @@ -430,6 +488,8 @@ public: /// \param rect Rectangle representing the drawing area or /// NullOpt to set the viewport to the entire target /// + /// \throws SDL2pp::Exceptions + /// /// \see http://wiki.libsdl.org/SDL_RenderSetViewport /// //////////////////////////////////////////////////////////// diff --git a/SDL2pp/SDL.hh b/SDL2pp/SDL.hh index 14f6052..ad7be95 100644 --- a/SDL2pp/SDL.hh +++ b/SDL2pp/SDL.hh @@ -60,6 +60,8 @@ public: /// /// \param flags Flags to pass to SDL_Init() /// + /// \throws SDL2pp::Exception + /// /// \see http://wiki.libsdl.org/SDL_Init /// //////////////////////////////////////////////////////////// @@ -100,6 +102,8 @@ public: /// \param flags Set of flags which determines which subsystems /// to initialize /// + /// \throws SDL2pp::Exception + /// /// \see http://wiki.libsdl.org/SDL_InitSubSystem /// //////////////////////////////////////////////////////////// diff --git a/SDL2pp/Texture.hh b/SDL2pp/Texture.hh index 52f3c35..98ac8bd 100644 --- a/SDL2pp/Texture.hh +++ b/SDL2pp/Texture.hh @@ -101,6 +101,8 @@ public: /// /// \param rect Specifies region to lock /// + /// \throws STL2pp::Exception + /// /// \see http://wiki.libsdl.org/SDL_LockAudioDevice /// //////////////////////////////////////////////////////////// @@ -123,6 +125,8 @@ public: /// \details /// Releases the lock /// + /// \see http://wiki.libsdl.org/SDL_UnlockAudioDevice + /// //////////////////////////////////////////////////////////// ~LockHandle(); @@ -176,6 +180,10 @@ public: /// \param w With of the texture in pixels /// \param h Height of the texture in pixels /// + /// \throws SDL2pp::Exception + /// + /// \see http://wiki.libsdl.org/SDL_CreateTexture + /// //////////////////////////////////////////////////////////// Texture(Renderer& renderer, Uint32 format, int access, int w, int h); @@ -244,6 +252,8 @@ public: /// \param pitch Number of bytes in a row of pixel data, including /// padding between lines /// + /// \throws SDL2pp::Exception + /// /// \see http://wiki.libsdl.org/SDL_UpdateTexture /// //////////////////////////////////////////////////////////// @@ -254,6 +264,8 @@ public: /// /// \param blendMode SDL_BlendMode to use for texture blending /// + /// \throws SDL2pp::Exception + /// /// \see http://wiki.libsdl.org/SDL_SetTextureBlendMode /// //////////////////////////////////////////////////////////// @@ -264,6 +276,10 @@ public: /// /// \param alpha Source alpha value multiplied into copy operations /// + /// \throws SDL2pp::Exception + /// + /// \see http://wiki.libsdl.org/SDL_SetTextureAlphaMod + /// //////////////////////////////////////////////////////////// void SetAlphaMod(Uint8 alpha = 255); @@ -274,6 +290,10 @@ public: /// \param g Green color value multiplied into copy operations /// \param b Blue color value multiplied into copy operations /// + /// \throws SDL2pp::Exception + /// + /// \see http://wiki.libsdl.org/SDL_SetTextureColorMod + /// //////////////////////////////////////////////////////////// void SetColorMod(Uint8 r = 255, Uint8 g = 255, Uint8 b = 255); @@ -285,6 +305,10 @@ public: /// /// \return Lock handle used to access pixel data and to control lock lifetime /// + /// \throws SDL2pp::Exception + /// + /// \see http://wiki.libsdl.org/SDL_LockTexture + /// //////////////////////////////////////////////////////////// LockHandle Lock(const Optional& rect = NullOpt); @@ -293,6 +317,9 @@ public: /// /// \return Texture raw format /// + /// \throws SDL2pp::Exception + /// + /// \see http://wiki.libsdl.org/SDL_QueryTexture /// \see http://wiki.libsdl.org/SDL_QueryTexture#format /// //////////////////////////////////////////////////////////// @@ -303,6 +330,9 @@ public: /// /// \return Texture access pattern /// + /// \throws SDL2pp::Exception + /// + /// \see http://wiki.libsdl.org/SDL_QueryTexture /// \see http://wiki.libsdl.org/SDL_TextureAccess /// //////////////////////////////////////////////////////////// @@ -313,6 +343,10 @@ public: /// /// \return Texture width in pixels /// + /// \throws SDL2pp::Exception + /// + /// \see http://wiki.libsdl.org/SDL_QueryTexture + /// //////////////////////////////////////////////////////////// int GetWidth() const; @@ -321,6 +355,10 @@ public: /// /// \return Texture height in pixels /// + /// \throws SDL2pp::Exception + /// + /// \see http://wiki.libsdl.org/SDL_QueryTexture + /// //////////////////////////////////////////////////////////// int GetHeight() const; }; diff --git a/SDL2pp/Wav.hh b/SDL2pp/Wav.hh index 733bdee..d3faf39 100644 --- a/SDL2pp/Wav.hh +++ b/SDL2pp/Wav.hh @@ -61,6 +61,10 @@ public: /// /// \param file Path to the wav file /// + /// \throws SDL2pp::Exception + /// + /// \see http://wiki.libsdl.org/SDL_LoadWAV + /// //////////////////////////////////////////////////////////// Wav(const std::string& file); @@ -69,6 +73,10 @@ public: /// /// \param rwops SDL2pp::RWops used to access wav data /// + /// \throws SDL2pp::Exception + /// + /// \see http://wiki.libsdl.org/SDL_LoadWAV_RW + /// //////////////////////////////////////////////////////////// Wav(RWops& rwops);