2 Copyright (C) 2015 Aaron Suen <warr1024@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published by
6 the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include "irrlichttypes_extrabloated.h"
23 /* Manually insert an image into the cache, useful to avoid texture-to-image
24 * conversion whenever we can intercept it.
26 void guiScalingCache(const io::path &key, video::IVideoDriver *driver, video::IImage *value);
28 // Manually clear the cache, e.g. when switching to different worlds.
29 void guiScalingCacheClear();
31 /* Get a cached, high-quality pre-scaled texture for display purposes. If the
32 * texture is not already cached, attempt to create it. Returns a pre-scaled texture,
33 * or the original texture if unable to pre-scale it.
35 video::ITexture *guiScalingResizeCached(video::IVideoDriver *driver, video::ITexture *src,
36 const core::rect<s32> &srcrect, const core::rect<s32> &destrect);
38 /* Convenience wrapper for guiScalingResizeCached that accepts parameters that
39 * are available at GUI imagebutton creation time.
41 video::ITexture *guiScalingImageButton(video::IVideoDriver *driver, video::ITexture *src,
42 s32 width, s32 height);
44 /* Replacement for driver->draw2DImage() that uses the high-quality pre-scaled
45 * texture, if configured.
47 void draw2DImageFilterScaled(video::IVideoDriver *driver, video::ITexture *txr,
48 const core::rect<s32> &destrect, const core::rect<s32> &srcrect,
49 const core::rect<s32> *cliprect = 0, const video::SColor *const colors = 0,
50 bool usealpha = false);
53 * 9-slice / segment drawing
55 void draw2DImage9Slice(video::IVideoDriver *driver, video::ITexture *texture,
56 const core::rect<s32> &rect, const core::rect<s32> &middle,
57 const core::rect<s32> *cliprect = nullptr);