diff --git a/SDL2pp/Surface.cc b/SDL2pp/Surface.cc index 3178ba0..7fc86fe 100644 --- a/SDL2pp/Surface.cc +++ b/SDL2pp/Surface.cc @@ -213,4 +213,8 @@ Point Surface::GetSize() const { return Point(surface_->w, surface_->h); } +Uint32 Surface::GetFormat() const { + return surface_->format->format; +} + } diff --git a/SDL2pp/Surface.hh b/SDL2pp/Surface.hh index 1703713..d932c2d 100644 --- a/SDL2pp/Surface.hh +++ b/SDL2pp/Surface.hh @@ -540,6 +540,17 @@ public: /// //////////////////////////////////////////////////////////// Point GetSize() const; + + //////////////////////////////////////////////////////////// + /// \brief Get texture format + /// + /// \return Surface raw format + /// + /// \see http://wiki.libsdl.org/SDL_Surface + /// \see http://wiki.libsdl.org/SDL_PixelFormatEnum + /// + //////////////////////////////////////////////////////////// + Uint32 GetFormat() const; }; }