Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/windowing/StarGuiContext.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-23 18:13:26 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-23 18:13:26 +1000
commit176c79bada5f175202a1f67828a9d4bfc208895c (patch)
tree7487030ad4227dd1bd223d202d699a7400305bcf /source/windowing/StarGuiContext.cpp
parentbab5f0bd1123034cce33e7519dbb33afbd04b081 (diff)
Hardware Cursor support
Updated SDL2 for this, so lib\ is no longer gitignored
Diffstat (limited to 'source/windowing/StarGuiContext.cpp')
-rw-r--r--source/windowing/StarGuiContext.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/windowing/StarGuiContext.cpp b/source/windowing/StarGuiContext.cpp
index 10cbefc..463e341 100644
--- a/source/windowing/StarGuiContext.cpp
+++ b/source/windowing/StarGuiContext.cpp
@@ -307,6 +307,15 @@ void GuiContext::drawImageStretchSet(ImageStretchSet const& imageSet, RectF cons
drawInterfaceQuad(imageSet.end, RectF(Vec2F(), Vec2F(textureSize(imageSet.end))), end, color);
}
+bool GuiContext::trySetCursor(Drawable const& drawable, Vec2I const& offset, int pixelRatio) {
+ if (!drawable.isImage())
+ return false;
+
+ auto assets = Root::singleton().assets();
+ auto& imagePath = drawable.imagePart().image;
+ return applicationController()->setCursorImage(imagePath, assets->image(imagePath), pixelRatio, offset);
+}
+
RectF GuiContext::renderText(String const& s, TextPositioning const& position) {
return textPainter()->renderText(s, position);
}