mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-09 23:41:14 -04:00
Implement Window::SetIcon
This commit is contained in:
parent
f9435a520e
commit
50a73c1377
@ -22,6 +22,7 @@
|
|||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
#include <SDL2pp/Window.hh>
|
#include <SDL2pp/Window.hh>
|
||||||
|
#include <SDL2pp/Surface.hh>
|
||||||
#include <SDL2pp/Exception.hh>
|
#include <SDL2pp/Exception.hh>
|
||||||
|
|
||||||
namespace SDL2pp {
|
namespace SDL2pp {
|
||||||
@ -213,4 +214,9 @@ Uint32 Window::GetFlags() const {
|
|||||||
return SDL_GetWindowFlags(window_);
|
return SDL_GetWindowFlags(window_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Window& Window::SetIcon(const Surface& icon) {
|
||||||
|
SDL_SetWindowIcon(window_, icon.Get());
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,8 @@ struct SDL_Window;
|
|||||||
|
|
||||||
namespace SDL2pp {
|
namespace SDL2pp {
|
||||||
|
|
||||||
|
class Surface;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
/// \brief GUI window object
|
/// \brief GUI window object
|
||||||
///
|
///
|
||||||
@ -474,6 +476,18 @@ public:
|
|||||||
///
|
///
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Uint32 GetFlags() const;
|
Uint32 GetFlags() const;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
/// \brief Set the icon for a window
|
||||||
|
///
|
||||||
|
/// \param[in] icon Surface containing the icon for the window
|
||||||
|
///
|
||||||
|
/// \see http://wiki.libsdl.org/SDL_SetWindowIcon
|
||||||
|
///
|
||||||
|
/// Icon surface may be destroyed after calling this function
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////
|
||||||
|
Window& SetIcon(const Surface& icon);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user