30 typedef SSIZE_T ssize_t;
33 #if !defined(HAS_NOEXCEPT)
34 #if defined(__clang__)
35 #if __has_feature(cxx_noexcept)
38 #elif defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 || \
39 defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026
51 SdlWidget(SDL_Renderer* renderer, SDL_Rect rect,
bool input);
52 #if defined(WITH_SDL_IMAGE_DIALOGS)
53 SdlWidget(SDL_Renderer* renderer, SDL_Rect rect, SDL_RWops* ops);
58 bool fill(SDL_Renderer* renderer, SDL_Color color);
59 bool fill(SDL_Renderer* renderer,
const std::vector<SDL_Color>& colors);
60 bool update_text(SDL_Renderer* renderer,
const std::string& text, SDL_Color fgcolor);
61 bool update_text(SDL_Renderer* renderer,
const std::string& text, SDL_Color fgcolor,
64 [[nodiscard]]
bool wrap()
const;
65 bool set_wrap(
bool wrap =
true,
size_t width = 0);
66 [[nodiscard]]
const SDL_Rect& rect()
const;
68 #define widget_log_error(res, what) SdlWidget::error_ex(res, what, __FILE__, __LINE__, __func__)
69 static bool error_ex(Uint32 res,
const char* what,
const char* file,
size_t line,
77 SDL_Texture* render_text(SDL_Renderer* renderer,
const std::string& text, SDL_Color fgcolor,
78 SDL_Rect& src, SDL_Rect& dst);
79 SDL_Texture* render_text_wrapped(SDL_Renderer* renderer,
const std::string& text,
80 SDL_Color fgcolor, SDL_Rect& src, SDL_Rect& dst);
82 TTF_Font* _font =
nullptr;
83 SDL_Texture* _image =
nullptr;
87 size_t _text_width = 0;
90 bool clear_window(SDL_Renderer* renderer);