aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform/graphics/web_canvas/WebCanvasRef.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-10-09 22:25:54 +0800
committercrupest <crupest@outlook.com>2023-10-09 22:25:54 +0800
commit78760fd8a5b310ca4e8de502e510b95c9b4c880c (patch)
treed53da9e28decf583d027cc8eb023c591e02ee73f /include/cru/platform/graphics/web_canvas/WebCanvasRef.h
parent1907d4fffd24e6d6bd1b7db7d903da60e53888dc (diff)
downloadcru-78760fd8a5b310ca4e8de502e510b95c9b4c880c.tar.gz
cru-78760fd8a5b310ca4e8de502e510b95c9b4c880c.tar.bz2
cru-78760fd8a5b310ca4e8de502e510b95c9b4c880c.zip
...
Diffstat (limited to 'include/cru/platform/graphics/web_canvas/WebCanvasRef.h')
-rw-r--r--include/cru/platform/graphics/web_canvas/WebCanvasRef.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/cru/platform/graphics/web_canvas/WebCanvasRef.h b/include/cru/platform/graphics/web_canvas/WebCanvasRef.h
new file mode 100644
index 00000000..4cb960bd
--- /dev/null
+++ b/include/cru/platform/graphics/web_canvas/WebCanvasRef.h
@@ -0,0 +1,24 @@
+#pragma once
+
+#include "cru/common/Base.h"
+
+#include <emscripten/val.h>
+
+namespace cru::platform::graphics::web_canvas {
+ class WebCanvasRef {
+ public:
+ explicit WebCanvasRef(emscripten::val canvas_val);
+
+ CRU_DEFAULT_COPY(WebCanvasRef)
+ CRU_DEFAULT_MOVE(WebCanvasRef)
+
+ CRU_DEFAULT_DESTRUCTOR(WebCanvasRef)
+
+ public:
+ int GetWidth() const;
+ int GetHeight() const;
+
+ private:
+ emscripten::val val_;
+ };
+}