Add Surface::GetFormat(), analogus to Texture::GetFormat()

This commit is contained in:
Dmitry Marakasov 2015-08-27 18:21:31 +03:00
parent 7b44685492
commit c54a021d8e
2 changed files with 15 additions and 0 deletions

View File

@ -213,4 +213,8 @@ Point Surface::GetSize() const {
return Point(surface_->w, surface_->h);
}
Uint32 Surface::GetFormat() const {
return surface_->format->format;
}
}

View File

@ -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;
};
}